regs.dsr and cur_dsr but they all say 0f_0B2E0 should be called0:B1CCH F00146A6 BL f_046A6
0:B1D0H A011 TB R0.1
0:B1D2H C907 BEQ +EH
0:B1D4H F00147F2 BL f_047F2
0:B1D8H 7000 CMP R0, #00H
0:B1DAH C80E BNE +1CH
0:B1DCH F0014686 BL f_04686
0:B1E0H CEF5 BAL -16H (edited)00:F014H is set00:F014H always reads 200:F014H is used for?00:F014H00:F014H to 0x20// DSR Prefix Instruction
void instr_dsr(struct u8_core *core, uint8_t flags, struct u8_oper *op0, struct u8_oper *op1) {
core->cur_dsr = oper_read(core, op0);
u8_step(core);
core->cur_dsr = 0;
} grep -r "dsr" . in src/core in u8_emu repo (edited)addr_m and addr_v which are supplied in memory region structs.
it takes the memory address, ANDs it with the value of addr_m, then if the result is equal to addr_v then the memory address is in that region.
i need to make 8E00H - EFFFH read only so i need to find appropriate values for addr_m and addr_v. but its hard af.// DSR Prefix Instruction
void instr_dsr(struct u8_core *core, uint8_t flags, struct u8_oper *op0, struct u8_oper *op1) {
core->cur_dsr = oper_read(core, op0);
u8_step(core);
core->cur_dsr = 0;
} 00:F011H to 00:F01FH[ON] key is not in the key matrix - It's connected to NMI pin of the chip def core_reset(self):
self.sim.core.regs.elr[1] = self.sim.core.regs.pc
self.sim.core.regs.ecsr[1] = self.sim.core.regs.csr
self.sim.core.regs.epsw[1] = self.sim.core.regs.psw
self.sim.core.regs.psw |= 2; self.sim.core.regs.psw &= -2
self.sim.core.regs.csr = 0
self.sim.core.regs.pc = self.nmi_addr
here i tried to see what happens if ON key triggers an NMI interruptshutdown, after the casio logo, it calls f_04680 which is in the middle of delay, specifically at the part where STPACP and SBYCON are set.
however on delta's core, the timer is already past the target at this point so STOP mode is never enabled...
(edited)#include <iostream>
int main() {
std::cout << "Hello, world!\n";
return;
}
vs.
#include <stdio.h>
int main() {
printf("Hello, world!\n");
return;
}using namespace std;-Wall would catch thatAX/EAX/rAX anyway (edited) ld hl, strHello
rst 38h
dw ti.PutS
ret
strHello:
db "Hello World!", 0std:: all the timestd, then others who uses your code might experience bugs (edited)import some_module
vs.
from some_module import *import some_module
vs.
from some_module import * some_module.inside vs insidebrkpointbreakpoint functionbrkpoint is in the past("addr_m", ctypes.c_uint32),
("addr_v", ctypes.c_uint32),
needs to be
("addr_l", ctypes.c_uint32),
("addr_h", ctypes.c_uint32),
and
# Initialise memory
self.code_mem = (ctypes.c_uint8 * len(rom))(*rom)
self.data_mem = (ctypes.c_uint8 * 0xE00)()
self.emu_kb = (ctypes.c_uint8 * 0x30)()
self.sfr = (ctypes.c_uint8 * 0x1000)()
regions = [
u8_mem_reg_t(u8_mem_type_e.U8_REGION_BOTH, False, 0x00000, 0x07FFF, u8_mem_acc_e.U8_MACC_ARR, _acc_union(uint8_ptr(self.code_mem, 0x00000))),
u8_mem_reg_t(u8_mem_type_e.U8_REGION_DATA, True, 0x08000, 0x08E00, u8_mem_acc_e.U8_MACC_ARR, _acc_union(uint8_ptr(self.data_mem, 0x00000))),
u8_mem_reg_t(u8_mem_type_e.U8_REGION_DATA, True, 0x08E00, 0x08E30, u8_mem_acc_e.U8_MACC_ARR, _acc_union(uint8_ptr(self.emu_kb, 0x00000))),
u8_mem_reg_t(u8_mem_type_e.U8_REGION_DATA, True, 0x0F000, 0x0FFFF, u8_mem_acc_e.U8_MACC_ARR, _acc_union(uint8_ptr(self.sfr, 0x00000))),
u8_mem_reg_t(u8_mem_type_e.U8_REGION_CODE, False, 0x08000, 0x0FFFF, u8_mem_acc_e.U8_MACC_ARR, _acc_union(uint8_ptr(self.code_mem, 0x08000))),
u8_mem_reg_t(u8_mem_type_e.U8_REGION_BOTH, False, 0x10000, 0x1FFFF, u8_mem_acc_e.U8_MACC_ARR, _acc_union(uint8_ptr(self.code_mem, 0x10000))),
u8_mem_reg_t(u8_mem_type_e.U8_REGION_DATA, False, 0x80000, 0x8FFFF, u8_mem_acc_e.U8_MACC_ARR, _acc_union(uint8_ptr(self.code_mem, 0x00000))),
]self.F0xxH range, which corrupts some hardware SFRs like the contrast SFR (hence why the screen gets a bit dimmer), and finally it writes to F031H which controls the LCD, effectively turning it off.??????rebranding?core.dat (rom file) with fx991cnx's rom.bin in ClassicEmu/modelsClassicEmu/models/991cnx)core.dat is encrypted in some wayrom.bin when it's not encrypted, it'll just get garbagencurses version of the emulator, but I still cannot boot the real romncurses version of the emulator, but I still cannot boot the real rom rom.bin when it's not encrypted, it'll just get garbage // !! Check for raw/encrypted ROM
if (romData[0] === 0 && romData[1] === 0xf0 && !(romData.length & romData.length - 1)) {
this._WriteCodeMemory(0, romData.length, romData)
} else {
this._LoadHexFile(rom, romData)
} (edited)core.dat (rom file) with fx991cnx's rom.bin in ClassicEmu/models takinekotfs/CASIO-fx is completely copied from others, and no more contribution will make in it (edited) if (!handler)
PANIC("unrecognized instruction %04X at %06zX\n", impl_opcode, (((size_t)reg_csr.raw) << 16) | (reg_pc.raw - 2));breakpoint functionmodels folder.fxESPLUS_Px.dll with one from another ES PLUS emulatorqSB/RB Dbitadr, now it sets the status bar properlyERROR...) (edited)3.141592653589793->BERROR or random errors (e returns Insufficient MEM lol); The index on the left of TABLE mode output is always 0-std=c99KO right F014H correctlyKO, when it's updated I will update KI according to key(s) pressedF014H is set to 0x20 every half a second to wake the CPU from stop modeF014H is set the calc will check for keys pressedF014H is not set correctlys, [enter] and [space] but none of them works; 2)The jump to function doesn't work, as it returns:
File "main.py", line 296, in set_csr_pc
self.sim.sim.core.regs.csr = int(csr_entry, 16) if csr_entry else 0
(...)
AttributeError: function 'core' not founds, [enter] and [space] but none of them works; 2)The jump to function doesn't work, as it returns:
File "main.py", line 296, in set_csr_pc
self.sim.sim.core.regs.csr = int(csr_entry, 16) if csr_entry else 0
(...)
AttributeError: function 'core' not found sim.sim.core.regs.csrself.bind('<Return>', lambda x: self.set_step()) to the __init__ of Sim[Enter]self.root.bind('<Return>', lambda x: self.set_step()) does the job for mePC and CSR are static variables in my emulator def get_var(self, var, typ): return typ.in_dll(self.sim, var)self.get_var('PC', ctypes.c_uint16).value = XXXX idk (edited)self.sim.get_var('PC', ctypes.c_uint16).value = XXXX
worksrunvoid* DataMemory) and read a block of memory from thereERRORERROR or random errors (e returns Insufficient MEM lol); The index on the left of TABLE mode output is always 0 ERRORERROR stringuint8_t[]ncursesos.mode := 080F9h so it replaces all 80F9hs to os.modeos.mode = 0xC1make lolmakemake but it didn't help when I tried to install SDL2make native as the tutorial suggested but it errors soSDL2.dll into the directory to make it work, it'll be finestr.length()public class Box {
private int size;
public void Box(size) {
this.size = size;
}
}class Box {
int size;
public:
void Box(size) {
this.size = size;
}
}reinterpret_cast<type>(value) while I can just do (type)value in Cpublic void parseInstruction(int o) --> void parseInstruction(Processor *p, int o)AC Break is the first error IDAC Break specifically instead of other errors0D when the function is jumped to)0:0902H0:0900H0:0958H just contains more string dataf_0320Ef_0BE8600:80FCH stores error codes?<conio> functions from the loopTraceback (most recent call last):
File "main.py", line 888, in <module>
sim = Sim()
File "main.py", line 453, in __init__
self.root = DebounceTk()
File "/usr/lib/python3.8/tkinter/__init__.py", line 2270, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variablecolor iirccoreDispRegs out of the emulator core since it's not contributing to the functionality and creates unnecessary dependence on I/O functions0x8000 bytes of segment 0 code (edited)0xD000 bytes0xD000 bytes 0xD000 - 0xEFFF on CWIF800H to FFFFHRan# doesn't do syntax errorstdio.h dependence of coreLICENSE, press "choose a license template"...ERROR....8DA4H8D9AH8CFAH nowmmu.h that allows you to save the RAMsavestate.h or something0x5A5A ticks on startup8DxxHEach sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
51.22 0.42 0.42 _mcount_private
23.17 0.61 0.19 7617578 0.00 0.00 coreStep
12.20 0.71 0.10 8628494 0.00 0.00 memoryGetCodeWord
4.88 0.75 0.04 1516594 0.00 0.00 memoryGetData
4.88 0.79 0.04 __fentry__
1.22 0.80 0.01 6259991 0.00 0.00 memorySetData
1.22 0.81 0.01 1 10.00 10.00 coreReset
1.22 0.82 0.01 _pushValue
0.00 0.82 0.00 1 0.00 0.00 memoryInit_mcount_privateEach sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
51.22 0.42 0.42 _mcount_private
23.17 0.61 0.19 7617578 0.00 0.00 coreStep
12.20 0.71 0.10 8628494 0.00 0.00 memoryGetCodeWord
4.88 0.75 0.04 1516594 0.00 0.00 memoryGetData
4.88 0.79 0.04 __fentry__
1.22 0.80 0.01 6259991 0.00 0.00 memorySetData
1.22 0.81 0.01 1 10.00 10.00 coreReset
1.22 0.82 0.01 _pushValue
0.00 0.82 0.00 1 0.00 0.00 memoryInit memoryGetCodeWord is slow89xxH % cumulative self self total
time seconds seconds calls ns/call ns/call name
67.24 0.39 0.39 _mcount_private
12.07 0.46 0.07 8628494 8.11 8.11 memoryGetCodeWord
10.34 0.52 0.06 7617578 7.88 21.71 coreStep
3.45 0.54 0.02 3564123 5.61 5.61 memorySetData
3.45 0.56 0.02 1516594 13.19 13.19 memoryGetData
3.45 0.58 0.02 __fentry__
0.00 0.58 0.00 1 0.00 16.23 coreReset
0.00 0.58 0.00 1 0.00 0.00 memoryFree
0.00 0.58 0.00 1 0.00 0.00 memoryInit
Ok this time it's faster with -OsmemoryGetData takes freaking 13.19ns per call, slower than coreStep wtf100x sqrt(5Amemset5A to the entire data segment 004:8E00H1BFF (edited)BRK instructionsBRK instructionsBRK is kind of like an interruptFFs__init__
def press_cb(event):
for k, v in config.keymap.items():
p = v[0]
if (event.type == tk.EventType.ButtonPress and event.x in range(p[0], p[0]+p[2]) and event.y in range(p[1], p[1]+p[3])) \
or (event.type == tk.EventType.KeyPress and event.keysym.lower() in v[1:]):
if k is None: self.reset_core(False)
elif config.real_hardware: self.keys_pressed.add(k)
else:
self.write_dmem(0x8e01, 1, 1 << k[0], self.emu_kb_seg)
self.write_dmem(0x8e02, 1, 1 << k[1], self.emu_kb_seg)
def release_cb(event):
if config.real_hardware:
for k, v in config.keymap.items():
if event.type == tk.EventType.KeyRelease and event.keysym.lower() in v[1:] and k is not None and k in self.keys_pressed: self.keys_pressed.remove(k)
elif event.type == tk.EventType.ButtonRelease: self.keys_pressed.clear()
else:
self.write_dmem(0x8e01, 1, 0, self.emu_kb_seg)
self.write_dmem(0x8e02, 1, 0, self.emu_kb_seg)
embed_pygame.bind('<KeyPress>', press_cb)
embed_pygame.bind('<KeyRelease>', release_cb)
embed_pygame.bind('<ButtonPress-1>', press_cb)
embed_pygame.bind('<ButtonRelease-1>', release_cb)press_cb checks the event type to see if its a keyboard press or mouse click
if its a mouse click, it checks if the X and Y positions are in the correct ranges
if its a keyboard press, it checks if the keysym is correct, i convert the keysym to lowercase so uppercase and lowercase will both work
then it checks if we're running in real ROM mode or emulator ROM mode
if its real, it adds the key we pressed to a set that keeps track of what keys are held down
if its emulator it writes to the emulator keyboard immediately (since you cannot hold keys on emulator) def keyboard(self):
if config.real_hardware:
ki = 0xff
ko = self.read_dmem(0xf046, 1)[0]
for ki_val, ko_val in self.keys_pressed:
if ko & (1 << ko_val): ki &= ~(1 << ki_val)
self.write_dmem(0xf040, 1, ki)
if len(self.keys_pressed) > 0: self.write_dmem(0xf014, 1, 2)
else:
ready = self.read_dmem(0x8e00, 1, self.emu_kb_seg)[0]
if not self.last_ready and ready:
self.write_dmem(0x8e01, 1, 0, self.emu_kb_seg)
self.write_dmem(0x8e02, 1, 0, self.emu_kb_seg)
self.last_ready = readypress_cb checks the event type to see if its a keyboard press or mouse click
if its a mouse click, it checks if the X and Y positions are in the correct ranges
if its a keyboard press, it checks if the keysym is correct, i convert the keysym to lowercase so uppercase and lowercase will both work
then it checks if we're running in real ROM mode or emulator ROM mode
if its real, it adds the key we pressed to a set that keeps track of what keys are held down
if its emulator it writes to the emulator keyboard immediately (since you cannot hold keys on emulator) keyboard function does run every frame#include <stdio.h>
#include <iostream>extern C {
} (edited)with cProfile.Profile() as pr thingcumtime 309259 0.273 0.000 1.363 0.000 main.py:782(read_dmem)1.363 is the cumtimeread_dmem implementation
def read_dmem(self, addr, num_bytes, segment = 0):
data = b''
bytes_grabbed = 0
if num_bytes > 8:
while bytes_grabbed < num_bytes:
remaining = num_bytes - bytes_grabbed
if remaining >= 8: grab = 8
else: grab = remaining
dt = self.sim.read_mem_data(segment, addr + bytes_grabbed, grab)
data += dt.to_bytes(grab, 'little')
bytes_grabbed += grab
return data
else: return self.sim.read_mem_data(segment, addr, num_bytes).to_bytes(num_bytes, 'little') 106442 0.071 0.000 0.490 0.000 main.py:782(read_dmem)
42952 0.017 0.000 0.240 0.000 main.py:799(write_dmem) (edited) 115562 0.401 0.000 0.457 0.000 main.py:219(read_mem_data)
23301 0.069 0.000 0.080 0.000 main.py:225(write_mem_data)
115562 0.080 0.000 0.554 0.000 main.py:781(read_dmem)
23301 0.010 0.000 0.091 0.000 main.py:798(write_dmem)read_dmem 136752 0.434 0.000 0.497 0.000 main.py:219(read_mem_data)
27539 0.096 0.000 0.108 0.000 main.py:225(write_mem_data)
136752 0.046 0.000 0.544 0.000 main.py:781(read_dmem)
27539 0.011 0.000 0.120 0.000 main.py:783(write_dmem)read_dmem calls with access directly to self.core.sfrread_dmem in the core thread
48715 0.145 0.000 0.168 0.000 main.py:219(read_mem_data)
49650 0.148 0.000 0.172 0.000 main.py:225(write_mem_data)
48715 0.019 0.000 0.187 0.000 main.py:781(read_dmem)
49650 0.019 0.000 0.191 0.000 main.py:783(write_dmem)1an/111111111111Ans^1 (fx-580VN X real) doesn't crash111111(1(1)r on fx-570ES+ VerE real still doesn't work, users emu also crashes111111(1(1)r on fx-570ES+ VerE real still doesn't work, users emu also crashes rCOMP mode[ON] is pushed--- Process 9952, exception 4000001f at 0000000075b09b87
--- Process 9952 thread 9992 exited with status 0xc0000409
--- Process 9952 thread 2984 exited with status 0xc0000409
--- Process 9952 thread 2968 exited with status 0xc0000409
--- Process 9952 thread 7552 exited with status 0xc0000409
--- Process 9952 thread 15624 exited with status 0xc0000409
--- Process 9952 thread 4648 exited with status 0xc0000409
--- Process 9952 exited with status 0xc0000409F811H controls the SHIFT and MODE indicatorsSHIFT is F811H.6, and MODE is F811H.2F813H.2 is MF814H and F815H control the DEG - RAD - GRA indicatorsIndicator F814H F815H
DEG 00000100 00000011
RAD 00000000 01000011
GRA 00000000 00000111u8-emu-frontend on my main PCLEA [ERm] to set EA to the word value of the address in ERm in life's emu, that caused some problemsLEA [ERm] is to set EA to the value of ERm0x80000xF000 bytesFxxxH are the SFRs[[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [2, 4, 1, 0, 4, 1, 2, 1], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]
my emulator has partial support for fx-82solar ii screen now, of course the screen itself is not implemented yet but the screen data is now properly formatted8172H8E00H - EFFFH set as read-only?8E00H - EFFFH set as read-only? add sp, #signed8 was wrong but no0002h in the romF050H as usual?3xP?MODE P_ value
f_046A6:
0:46A6H 7003 CMP R0, #03H
0:46A8H C107 BLT .l_012
0:46AAH 0109 MOV R1, #09H
.l_006:
0:46ACH 11FF ADD R1, #-1H
0:46AEH 8001 ADD R0, R0
0:46B0H C0FD BGE .l_006
0:46B2H C901 BEQ .l_010
0:46B4H 0110 MOV R1, #10H
.l_010:
0:46B6H 8010 MOV R0, R1
.l_012:
0:46B8H FE1F RT2 0x4
3 0x8
4 0x10
5 0x20
6 0x40
7 0x80import calc_pd
for i in range(0x100):
val = calc_pd.calc_pd(i)
if val is not None and val < 10: print(val, hex(i))MODE P0 corresponds to pd value 1MODE P1 is pd value 2[SimU8.dll+16CE88] corresponds to segment 1 code (edited)ERROR on any calculation when emulating real 570ES+ (edited)mov psw, #imm89000H to 18:FFFFH?0:D654H (edited)2:5342H 0050 MOV R0, #50H
2:5344H D0F6 ST R0, -AH[FP]
2:5346H 0072 MOV R0, #72H
2:5348H D0F7 ST R0, -9H[FP]
2:534AH 0065 MOV R0, #65H
2:534CH D0F8 ST R0, -8H[FP]
2:534EH 0073 MOV R0, #73H
2:5350H D0F9 ST R0, -7H[FP]
2:5352H D0FA ST R0, -6H[FP]
2:5354H 0020 MOV R0, #20H
2:5356H D0FB ST R0, -5H[FP]
2:5358H 0041 MOV R0, #41H
2:535AH D0FC ST R0, -4H[FP]
2:535CH 0043 MOV R0, #43H
2:535EH D0FD ST R0, -3H[FP]
2:5360H 0000 MOV R0, #00H
2:5362H D0FE ST R0, -2H[FP]
2:5364H E000 MOV ER0, #00H
2:5366H B0F4 ST ER0, -CH[FP]
2:5368H 0045 MOV R0, #45H
2:536AH 90E9FFCA ST R0, -0036H[ER14]
2:536EH 0059 MOV R0, #59H
2:5370H 90E9FFCB ST R0, -0035H[ER14]
2:5374H 002D MOV R0, #2DH
2:5376H 90E9FFCC ST R0, -0034H[ER14]
2:537AH 0030 MOV R0, #30H
2:537CH 90E9FFCD ST R0, -0033H[ER14]
2:5380H 0032 MOV R0, #32H
2:5382H 90E9FFCE ST R0, -0032H[ER14]
2:5386H 0033 MOV R0, #33H
2:5388H 90E9FFCF ST R0, -0031H[ER14]
2:538CH 0000 MOV R0, #00H
2:538EH 90E9FFD0 ST R0, -0030H[ER14]
2:5392H 90E9FFD1 ST R0, -002FH[ER14]0:00E2H2:53F0H 0000 MOV R0, #00H
2:53F2H 90E9FFC4 ST R0, -003CH[ER14]
2:53F6H 0056 MOV R0, #56H
2:53F8H 90E9FFD1 ST R0, -002FH[ER14]
2:53FCH 002E MOV R0, #2EH
2:53FEH 90E9FFD2 ST R0, -002EH[ER14]
2:5402H 901000E2 L R0, 00E2H
2:5406H 90E9FFD3 ST R0, -002DH[ER14]
2:540AH 901000E3 L R0, 00E3H
2:540EH 90E9FFD4 ST R0, -002CH[ER14]
2:5412H 0020 MOV R0, #20H
2:5414H 90E9FFD5 ST R0, -002BH[ER14]
2:5418H 0042 MOV R0, #42H
2:541AH 90E9FFD6 ST R0, -002AH[ER14]
2:541EH 0074 MOV R0, #74H
2:5420H 90E9FFD7 ST R0, -0029H[ER14]
2:5424H 0020 MOV R0, #20H
2:5426H 90E9FFD8 ST R0, -0028H[ER14]Press AC text) (edited)0:00D8H has the Reset All string0:A7F2H 02D8 MOV R2, #D8H
0:A7F4H 0300 MOV R3, #00H
0:A7F6H 0021 MOV R0, #21H
0:A7F8H F101FEC8 BL f_1FEC8diagnostic#AAAAAA (R: 170, G: 170, B: 170)
2: #555555(R: 85, G: 85, B: 85)
3: #000000(R: 0, G: 0, B: 0) (edited)DSR: prefix?DSR: prefix, DSR changes to... E4?????if self.sim.core.regs.dsr > 8: logging.warning(f'DSR is above 8 (DSR = {self.sim.core.regs.dsr:02X}) @ {self.sim.core.regs.csr:X}:{self.sim.core.regs.pc:04X}H')prev_csr_pcDSR: prefix[05/10/2023 19:06:04] WARNING: DSR too high (DSR = C0) @ 3:CC52H3:CC52H FE9FA2690002 ST ER2, DSR:+0002H[ER6]DSR: prefixingsin^-1(cos^-1(tan^-1(tan(cos(sin(9 rnf_2B094 in fx-580VN X real rom91C9H is the current screen bufferD654H, !=0 = CA54Hf_38018 on fx-92 Collège emu romCMPC?3:8028H 70FF CMP R0, #FFH
3:802AH 51FF CMPC R1, #FFH
3:802CH C302 BLE .l_01A
3:802EH F30080E2 B f_380E2F8x2BLE it never jumpsCMP, the carry flag is set so CMPC would do F8 - FF - 1ReadCodeMemory calls in their emulatorsReadCodeMemory a bunch of times in the source code, so how did they do it? (edited)diag_checksumCMPCCMPC for the cursorER0 holds an address to screen data3:E4F8H F085 MOV ER0, ER8
3:E4FAH E082 ADD ER0, #02H
3:E4FCH 70FF CMP R0, #FFH
3:E4FEH 51FF CMPC R1, #FFH
3:E500H C302 BLE .l_01A
3:E502H F300E5B6 B f_3E5B6CMP and CMPCs are to check if ER0 <= 0xFFFFCMP, usually the carry flag will always be set hereCMPC, since the carry flag is added to the second operandR1 - (0xFF + 1) = R1 - 0R1 - 0xFF - 1// Sign extend
uint64_t m = 1 << (size * 8);
val0 |= (val0 & (m >> 1)) << 1;
val1 |= (val1 & (m >> 1)) << 1;
val0 = (val0 ^ m) - m;
...R1 - (0xFF + 1) = R1 - 0 CMPC, since the carry flag is added to the second operand ADDC R0, #FFh while R0 is 0 and Carry is setadd r0, 0 so CZSV is 0100; But if the addition is done in 2 steps, CZSV should be 1100CMP and CMPC takes same amount of cycles, btw3:E4F8H F085 MOV ER0, ER8
3:E4FAH E082 ADD ER0, #02H
3:E4FCH 70FF CMP R0, #FFH
3:E4FEH 51FF CMPC R1, #FFH
3:E500H C302 BLE .l_01A
3:E502H F300E5B6 B f_3E5B6 0xFFFF as signed then it would mean the code checks if ER0 is negativeCMPC is correctCMPC is wrongCMP ER0, 0FFFFhadd, sub, etc., operates on any dataadd r0, 7fh when R0 is 2 returns 81hin R0, and CZVS are set to 00117Fh+02h=81h, so it's NC, NZ), or signed (so it's +7Fh + +02h = -7Fh, so NZ, OV, NS)an hacks1an/111111111111Ans^1 behaves like my frontendCMPLX -> 360
MAT -> SI
VCT -> DMYMath was removedMODE P0 = Pd value 1MODE P-u8-emu-frontend.
To run: extract all the files in the root folder then run python main.py <config filename>.l_05A:
0:465CH F0012FFC BL render
0:4660H F0014400 BL check_ac.set_ko
0:4664H 8000 MOV R0, R0
0:4666H C9FA BEQ .l_05A
0:4668H F001432C BL set_f046
.l_06A:
0:466CH A1EA MOV SP, ER14
0:466EH CEC7 BAL diag_scr_box_ws.exitcheck_ac.set_ko which is this
check_ac.set_ko:
0:4400H F8CE PUSH LR
0:4402H FA5E PUSH ER10
0:4404H 0A44 MOV R10, #44H
0:4406H 0BF0 MOV R11, #F0H
0:4408H 02EF MOV R2, #EFH
0:440AH 92A1 ST R2, [ER10]
0:440CH E000 MOV ER0, #00H
0:440EH CE0B BAL check_ac.exit
check_ac:
0:4410H 0203 MOV R2, #03H
.l_002:
0:4412H A0A1F040 TB F040H.2
0:4416H C807 BNE .exit
0:4418H 12FF ADD R2, #-1H
0:441AH C8FB BNE .l_002
0:441CH 0004 MOV R0, #04H
0:441EH 0110 MOV R1, #10H
0:4420H 901380F2 ST ER0, 80F2H
0:4424H E001 MOV ER0, #01H
.exit:
0:4426H F00143E4 BL set_ko_ff
0:442AH FA1E POP ER10
0:442CH F28E POP PCcheck_ac.set_ko only... sets KOcheck_ac:
0:4400H F8CE PUSH LR
0:4402H FA5E PUSH ER10
0:4404H 0A44 MOV R10, #44H
0:4406H 0BF0 MOV R11, #F0H
0:4408H 02EF MOV R2, #EFH
0:440AH 92A1 ST R2, [ER10]
0:440CH E000 MOV ER0, #00H
0:440EH CE0B BAL .exit
.check:
0:4410H 0203 MOV R2, #03H
.loop:
0:4412H A0A1F040 TB F040H.2
0:4416H C807 BNE .exit
0:4418H 12FF ADD R2, #-1H
0:441AH C8FB BNE .loop
0:441CH 0004 MOV R0, #04H
0:441EH 0110 MOV R1, #10H
0:4420H 901380F2 ST ER0, 80F2H
0:4424H E001 MOV ER0, #01H
.exit:
0:4426H F00143E4 BL set_ko_ff
0:442AH FA1E POP ER10
0:442CH F28E POP PCtb is probably wrong159A4h contains tb r11.1 and our emulator returned different results in Z flag (edited)cmp is wrongTB implementation affects C, but the manual didn't say soCMPC i think should be done in 2 steps
F822 - FFFF should totally give carry3:E4F8H F085 MOV ER0, ER8
3:E4FAH E082 ADD ER0, #02H
3:E4FCH 70FF CMP R0, #FFH
3:E4FEH 51FF CMPC R1, #FFH
3:E500H C302 BLE .l_01A
3:E502H F300E5B6 B f_3E5B6 BLE is unsigned <=BL ERn is wrongPC+4 rather than PC+2 while the instruction is only 1 word long1+1! But sqrt(2) returns... not 1.4142135621+1! But sqrt(2) returns... not 1.414213562 Math ERRORsqrt(1.9999999999999999 returns 1.414213562 printf("--\n");
printf("PC: %hx\n", core->regs.pc);
for (int i = 0; i < 16; i++) printf("R%d: %hhd\n", i, core->regs.gp[i]); here: https://github.com/Fraserbc/u8_emu/blob/main/src/core/core.c#L19 (edited)sqrt(1.9999999999999999 returns 1.414213562 printf("--\n");
printf("PC: %hx\n", core->regs.pc);
for (int i = 0; i < 16; i++) printf("R%d: %hhd\n", i, core->regs.gp[i]); here: https://github.com/Fraserbc/u8_emu/blob/main/src/core/core.c#L19 (edited)2Pd- Read OK appearsPd- Read OK appears delay...8E00H to 28E00H to 2 on the official emulator freezes it until you press ON8E00H to 2 on the official emulator freezes it until you press ON 8E00H byte write_mem_data(&ctx->core, 0, 0x8e01, 1, keys[i].ki);
write_mem_data(&ctx->core, 0, 0x8e02, 1, keys[i].ko); this is rather... unsatisfyingExecute function is long as hell8E00H = 2 will still be a mysterylru_cache for the screen byte grabbing functionB is jump, BL is call(like on ARM which sets LR)push lr is a way to backup LR for nested callsbl xxxx \...\ xxxx: push lrpop pc is... retcall => 98ae
ret => c5ae
bad return going to c5ae but lr = 98aepop pc is... ret rt98ae is an addressfar_call_stub push lr
push er8
mov er8, er0
;;void y(x z) { z(); z(); }
bl er0
bl er8
pop er8
pop pc
end push lr
push er8
mov er8, er0
;;void y(x z) { z(); z(); }
bl er0
bl er8
pop er8
pop pc
end void instr_bl(struct u8_core *core, uint8_t flags, struct u8_oper *op0, struct u8_oper *op1) {
core->regs.lcsr = core->regs.csr;
core->regs.lr = core->regs.pc;
core->regs.csr = oper_read(core, op0);
core->regs.pc = op1->addr;
core->wwce_call(core->regs.lr);
if (read_mem_code(core, core->regs.csr, core->regs.pc, 2) == 0xF28E) {
core->wwce_call(read_mem_data(core, core->cur_dsr, core->regs.sp, 2));
}
}void wwce_gather_feedback(uint16_t pc, uint16_t csr, bool btaken) {
uint32_t realpc = uint32_t(pc) | (uint32_t(csr) << 16);
printf("%05x => %s\n", realpc, btaken ? "taken" : "not taken");
} quality codevoid wwce_gather_feedback(uint16_t pc, uint16_t csr, bool btaken) {
uint32_t realpc = uint32_t(pc) | (uint32_t(csr) << 16);
printf("%05x => %s\n", realpc, btaken ? "taken" : "not taken");
} quality code case 0b0000: { // BGE
if (!(c == 0)) { BNT(); return; }
break;
} repeat for every branch#define BNT() core->wwce_gather_feedback(core->regs.pc, core->regs.csr, false);
#define BT() core->wwce_gather_feedback(core->regs.pc, core->regs.csr, true);1 1 1 1 1 1 1 &[KI4 KO0] [sin] [RCL] [x^n] &[KI2 KO0] 0 &[KI4 KO0] 1 &[KI2 KO0] = [DEL] [sin] [DEL] causes an error (edited) 1 1 1 1 1 1 1 &[KI4 KO0] [sin] [RCL] [x^n] &[KI2 KO0] 0 &[KI4 KO0] 1 &[KI2 KO0] = here is another inputf_17B1E:
1:7B1EH F8CE PUSH LR
1:7B20H 90108000 L R0, 8000H
1:7B24H 8100 MOV R1, R0
1:7B26H 200F AND R0, #0FH
1:7B28H 914C SRL R1, 4
1:7B2AH 020A MOV R2, #0AH
1:7B2CH 8208 SUB R2, R0
1:7B2EH 9310800D L R3, 800DH
1:7B32H 2302 AND R3, #02H
1:7B34H C81F BNE .l_056
1:7B36H 7108 CMP R1, #08H
1:7B38H C108 BLT .l_02C
1:7B3AH C803 BNE .l_024
1:7B3CH 120A ADD R2, #0AH
1:7B3EH 7002 CMP R0, #02H
1:7B40H C104 BLT .l_02C
.l_024:
1:7B42H 9310800E L R3, 800EH
1:7B46H 7300 CMP R3, #00H
1:7B48H C901 BEQ .l_02E
.l_02C:
1:7B4AH 0200 MOV R2, #00H
.l_02E:
1:7B4CH 9310800D L R3, 800DH
1:7B50H 7302 CMP R3, #02H
1:7B52H C103 BLT .l_03C
1:7B54H C804 BNE .l_040
1:7B56H 8221 ADD R2, R2
1:7B58H CE0A BAL .l_050
.l_03C:
1:7B5AH 1201 ADD R2, #01H
1:7B5CH CE08 BAL .l_050
.l_040:
1:7B5EH 730A CMP R3, #0AH
1:7B60H C103 BLT .l_04A
1:7B62H F1017BB4 BL f_17BB4
1:7B66H CE02 BAL .l_04E
.l_04A:
1:7B68H F1017B7E BL f_17B7E
.l_04E:
1:7B6CH 0200 MOV R2, #00H
.l_050:
1:7B6EH 9211800F ST R2, 800FH
1:7B72H F28E POP PC
.l_056:
1:7B74H 7109 CMP R1, #09H
1:7B76H C1E9 BLT .l_02C
1:7B78H 7001 CMP R0, #01H
1:7B7AH C1E7 BLT .l_02C
1:7B7CH CEE2 BAL .l_024 vm.write(0x8e01, ki);
vm.write(0x8e02, ko);1 1 1 3 &[KI8 KO0] [tan] 7 &[KI4 KO0] ) &[KI0 KO0] 3 &[KI4 KO0] [hyp] = 3 [log_x] &[KI0 KO0] = same "failure" mode different inputvoid instr_rt(struct u8_core *core, uint8_t flags, struct u8_oper *op0, struct u8_oper *op1) {
core->wwce_return(core->regs.lr);
core->regs.csr = core->regs.lcsr;
core->regs.pc = core->regs.lr;
}u8core/core/instr.c:271:15: runtime error: left shift of negative value -1
u8core/core/instr_impl.c:232:16: runtime error: shift exponent 18446744073709551615 is too large for 64-bit type 'long unsigned int'1 1 1 1 1 1 1 1 1 1 1 [M+] &[KI8 KO0] [cos] 1 [cos] [(-)] 1 [M+] another failing input1 1 1 1 . [cos] [DEL] [M+] [cos] 6 [M+]c++
uint8_t ready = vm.read(0x8e00);
if (readyp < ready) {
if (ckey == numkeys) {
if (doexit) {
vm.paint();
exit(1);
}
printf("\x1b[H\x1b[2J\x1b[3J");
vm.paint();
return; // keys drained
}
uint8_t kc = keys[ckey++];
uint8_t ki = 1 << (kc >> 4);
uint8_t ko = 1 << (kc & 0xf);
vm.write(0x8e01, ki);
vm.write(0x8e02, ko);
}
readyp = ready;1 1 1 1 [cos] 4 9 [M+] turns into 9 sqrt sqrtc++
struct VM {
uint8_t ram[0xe00];
uint8_t kbd[0x30];
uint8_t sfr[0x1000];
u8_core c;
u8_mem_reg r[7] {
data(0x8000, 0xE00, mem(ram)),
data(0x8e00, 0x30, mem(kbd)),
data(0xf000, 0x1000, mem(sfr)),
text(0, 0x8000, mem(code)),
code(0x8000, 0x8000, mem(code + 0x8000)),
text(0x10000, 0x10000, mem(code + 0x10000)),
rodata(0x80000, 0x10000, mem(code)),
};
VM() {
memset(ram, 0, sizeof(ram));
memset(kbd, 0, sizeof(kbd));
memset(sfr, 0, sizeof(sfr));
c.mem.num_regions = 7;
c.mem.regions = r;
c.wwce_call = wwce_call;
c.wwce_return = wwce_return;
c.wwce_gather_feedback = wwce_gather_feedback;
u8_reset(&c);
}
VM(VM& other) : c{other.c} {
r[0] = data(0x8000, 0xE00, mem(ram));
r[1] = data(0x8e00, 0x30, mem(kbd));
r[2] = data(0xf000, 0x1000, mem(sfr));
memcpy(ram, other.ram, sizeof(ram));
memcpy(kbd, other.kbd, sizeof(kbd));
memcpy(sfr, other.sfr, sizeof(sfr));
c.wwce_call = wwce_call;
c.wwce_return = wwce_return;
c.wwce_gather_feedback = wwce_gather_feedback;
c.mem.regions = r;
}
uint8_t read(uint32_t addr) {
return read_mem_data(&c, 0, addr, 1);
}
void write(uint32_t addr, uint8_t val) {
write_mem_data(&c, 0, addr, 1, val);
}
void next() {
u8_step(&c);
}
void paint() {
render(&c);
}
};git clone https://u8.malwarez.xyz/git/wwce#define mem(addr) .acc = U8_MACC_ARR, .array = addr,
#define text(addr, len, acc) u8_mem_reg{.type = U8_REGION_BOTH, .rw = false, .addr_l = addr, .addr_h = addr + len - 1, acc}
#define code(addr, len, acc) u8_mem_reg{.type = U8_REGION_CODE, .rw = false, .addr_l = addr, .addr_h = addr + len - 1, acc}
#define rodata(addr, len, acc) u8_mem_reg{.type = U8_REGION_DATA, .rw = false, .addr_l = addr, .addr_h = addr + len - 1, acc}
#define data(addr, len, acc) u8_mem_reg{.type = U8_REGION_DATA, .rw = true, .addr_l = addr, .addr_h = addr + len - 1, acc} memset(vm.ram, 0, sizeof(vm.ram));
memset(vm.kbd, 0, sizeof(vm.kbd));
memset(vm.sfr, 0, sizeof(vm.sfr));
u8_reset(&vm.c);[Left] [tan] 1 1 =9712 98ae c7e2 45a6 4538 3a3a 3930 366c 8f3a 6dc8 77ae calltrace notebl f_17bb4
r2 = 0
[0x800f] = r2
pop pc0x7bb4: push {lr}
0x7bb6: cmp r2, 0
0x7bb8: b.nv 0x7bbe
0x7bba: cmp r2, 0xb
0x7bbc: b.lt 0x7bc0
0x7bc0: add r2, 0xff
0x7bc2: mov er4, 0xa
0x7bc4: mul er4, r2
0x7bc6: mov r0, 0x48
0x7bc8: mov r1, 0x10
0x7bca: add er4, er0
0x7bcc: lea [er4]
0x7bce: ld qr0, [ea+]
0x7bd0: ld er8, [ea+]
0x7bd2: ld r0, [0x8010]
0x7bd6: lea [0x8010]
0x7bda: st qr0, [ea+]
0x7bdc: st er8, [ea+]
0x7bde: rt
0x7b66: b.nop 0x7b6c
0x7b6c: mov r2, 0
0x7b6e: st r2, [0x800f]
0x7b72: pop {pc}0x7bb4: push {lr}
0x7bb6: cmp r2, 0
0x7bb8: b.nv 0x7bbe
0x7bba: cmp r2, 0xb
0x7bbc: b.lt 0x7bc0
0x7bc0: add r2, 0xff
0x7bc2: mov er4, 0xa
0x7bc4: mul er4, r2
0x7bc6: mov r0, 0x48
0x7bc8: mov r1, 0x10
0x7bca: add er4, er0
0x7bcc: lea [er4]
0x7bce: ld qr0, [ea+]
0x7bd0: ld er8, [ea+]
0x7bd2: ld r0, [0x8010]
0x7bd6: lea [0x8010]
0x7bda: st qr0, [ea+]
0x7bdc: st er8, [ea+]
0x7bde: rt
0x7b66: b.nop 0x7b6c
0x7b6c: mov r2, 0
0x7b6e: st r2, [0x800f]
0x7b72: pop {pc} ld lol, is that ARM mnemonic?0x7bb4: push {lr}
0x7bb6: cmp r2, 0
0x7bb8: b.nv 0x7bbe
0x7bba: cmp r2, 0xb
0x7bbc: b.lt 0x7bc0
0x7bc0: add r2, 0xff
0x7bc2: mov er4, 0xa
0x7bc4: mul er4, r2
0x7bc6: mov r0, 0x48
0x7bc8: mov r1, 0x10
0x7bca: add er4, er0
0x7bcc: lea [er4]
0x7bce: ld qr0, [ea+]
0x7bd0: ld er8, [ea+]
0x7bd2: ld r0, [0x8010]
0x7bd6: lea [0x8010]
0x7bda: st qr0, [ea+]
0x7bdc: st er8, [ea+]
0x7bde: rt
0x7b66: b.nop 0x7b6c
0x7b6c: mov r2, 0
0x7b6e: st r2, [0x800f]
0x7b72: pop {pc} 0x7bbe should be 7bbeh)b.cond is wrongld should be lDadr is not wrapped in bracketsDAA/DAS implementation is wrong (edited)HC flag0x7bbe should be 7bbeh)b.cond is wrongld should be lDadr is not wrapped in bracketsb 0:1234WriteCodeMemory a bunch of times which actually writes the romWriteRom* functions call WriteCodeMemorycrop = config.status_bar_crops[i]
IndexError: tuple index out of rangecrop = config.status_bar_crops[i]
IndexError: tuple index out of range F040H = 0xDBcheck_diag_key:
3:8334H F8CE PUSH LR
3:8336H F45E PUSH ER4
3:8338H 0501 MOV R5, #01H
3:833AH 0405 MOV R4, #05H
3:833CH 0010 MOV R0, #10H
3:833EH 9011F046 ST R0, F046H
3:8342H F20130DA BL delay_1c
.l_012:
3:8346H 9010F040 L R0, F040H
3:834AH 70DB CMP R0, #DBH
3:834CH C805 BNE .l_024
3:834EH F20130EA BL delay_10c
3:8352H 14FF ADD R4, #-1
3:8354H 8040 MOV R0, R4
3:8356H C8F7 BNE .l_012
.l_024:
3:8358H 7400 CMP R4, #00H
3:835AH C807 BNE .l_036
3:835CH 0004 MOV R0, #04H
3:835EH 901191E0 ST R0, 91E0H
3:8362H 0010 MOV R0, #10H
3:8364H 901191E1 ST R0, 91E1H
3:8368H 0500 MOV R5, #00H
.l_036:
3:836AH F0017076 BL set_ko_0
3:836EH 8050 MOV R0, R5
3:8370H F41E POP ER4
3:8372H F28E POP PCif (ctx->core.regs.pc == 0x2ec0 || count % 1000 == 0) what's located at 0x2ec0?if (ctx->core.regs.pc == 0x2ec0 || count % 1000 == 0) what's located at 0x2ec0? void render(struct u8_sim_ctx *ctx)
{
int offset = 0;
for (int y = 0; y < 31; y++)
{
for (int x = 0; x < (96 / 8); x++)
{
uint8_t byte = read_mem_data(&ctx->core, 0, 0xf800 + offset, 1);
for (int i = 0; i < 7; i++)
{
if (byte & 0x01)
gfx_draw_pixel(&myGfx, (x * 8) + i, y, RGB565_WHITE);
else
gfx_draw_pixel(&myGfx, (x * 8) + i, y, RGB565_BLACK);
byte = byte >> 1;
}
offset++;
}
}
} res = sub_impl(val0, val1, op0->size, &psw0);
res = sub_impl(res, carry, op0->size, &psw1);
to
res = sub_impl(val0, carry, op0->size, &psw0);
res = sub_impl(res, val1, op0->size, &psw1); (edited)num_add in fx-880BTG emu romF022HF020H?F022H with F020HF008H5xH byte will be written to it, then immediately followed by AxH, in that exact orderF009H.1) (edited)F014H to 2F014H is set to 20HF014H is an IRQ SFRsimwrapper.js of the online classpad emulator
const REG = {
// ...
// SFR
STPACP: 0xF008,
SBYCON: 0xF009,
IE0: 0xF010,
IE1: 0xF011,
IRQ0: 0xF014,
IRQ1: 0xF015,
} (edited)// interrupt table
const _intr_tbl = [
// [vector_adrs, ie_adrs, ie_bit, irq_adrs, irq_bit, intname]
[ 0x0008, 0x0000, 0, 0xf014, 0, "WDTINT" ],
[ 0x000a, 0xf010, 1, 0xf014, 1, "XI0INT" ],
[ 0x000c, 0xf010, 2, 0xf014, 2, "XI1INT" ],
[ 0x000e, 0xf010, 3, 0xf014, 3, "XI2INT" ],
[ 0x0010, 0xf010, 4, 0xf014, 4, "XI3INT" ],
[ 0x0012, 0xf010, 5, 0xf014, 5, "TM0INT" ],
[ 0x0014, 0xf010, 6, 0xf014, 6, "L256SINT" ],
[ 0x0016, 0xf010, 7, 0xf014, 7, "L1024SINT" ],
[ 0x0018, 0xf011, 0, 0xf015, 0, "L4096SINT" ],
[ 0x001a, 0xf011, 1, 0xf015, 1, "L16384SINT"],
[ 0x001c, 0xf011, 2, 0xf015, 2, "SIO0INT" ],
[ 0x001e, 0xf011, 3, 0xf015, 3, "I2C0INT" ],
[ 0x0020, 0xf011, 4, 0xf015, 4, "I2C1INT" ],
[ 0x0022, 0xf011, 5, 0xf015, 5, "BENDINT" ],
[ 0x0024, 0xf011, 6, 0xf015, 6, "BLOWINT" ],
[ 0x0026, 0xf011, 7, 0xf015, 7, "RTCINT" ],
[ 0x0028, 0xf012, 0, 0xf016, 0, "AL0INT" ],
[ 0x002a, 0xf012, 1, 0xf016, 1, "AL1INT" ]
];SimU8.dll is made by oki/lapis so this is very accurate (lapis probably licensed the SimU8.dll source code to casio) (edited)F040H to DBH, on startup it should go to the fake math problem test screen, but it doesn't appear
(i am talking about this screen below)
1+1=? 00/01
Press AC.l_0BC:
1:D602H 0028 MOV R0, #28H
1:D604H 9011F400 ST R0, F400H
1:D608H A0F1F410 TB F410H.7
1:D60CH C802 BNE .l_0CC
1:D60EH 1E03 ADD R14, #03H
1:D610H CEF8 BAL .l_0BCF410H to 80HF410H when the core gets stuck in that spotcalc_checksum:
2:3136H F8CE PUSH LR
2:3138H F87E PUSH QR8
2:313AH E800 MOV ER8, #00H
2:313CH 0E00 MOV R14, #00H
2:313EH 0FFC MOV R15, #FCH
2:3140H EA00 MOV ER10, #00H
2:3142H F0AA LEA [ER10]
.l_00E:
2:3144H E3089A52 L ER10, 8:[EA+]
2:3148H FE8F NOP
2:314AH 88A8 SUB R8, R10
2:314CH 89B9 SUBC R9, R11
2:314EH EEFE ADD ER14, #7EH
2:3150H C8F9 BNE .l_00E
2:3152H EE00 MOV ER14, #00H
2:3154H EA00 MOV ER10, #00H
2:3156H F0AA LEA [ER10]
.l_022:
2:3158H E3019A52 L ER10, 1:[EA+]
2:315CH FE8F NOP
2:315EH 88A8 SUB R8, R10
2:3160H 89B9 SUBC R9, R11
2:3162H EEFE ADD ER14, #7EH
2:3164H C8F9 BNE .l_022
2:3166H EE00 MOV ER14, #00H
2:3168H EA00 MOV ER10, #00H
2:316AH F0AA LEA [ER10]
.l_036:
2:316CH E3029A52 L ER10, 2:[EA+]
2:3170H FE8F NOP
2:3172H 88A8 SUB R8, R10
2:3174H 89B9 SUBC R9, R11
2:3176H EEFE ADD ER14, #7EH
2:3178H C8F9 BNE .l_036
2:317AH EE00 MOV ER14, #00H
2:317CH EA00 MOV ER10, #00H
2:317EH F0AA LEA [ER10].l_04A:
2:3180H E3039A52 L ER10, 3:[EA+]
2:3184H FE8F NOP
2:3186H 88A8 SUB R8, R10
2:3188H 89B9 SUBC R9, R11
2:318AH EEFE ADD ER14, #7EH
2:318CH C8F9 BNE .l_04A
2:318EH EE00 MOV ER14, #00H
2:3190H EA00 MOV ER10, #00H
2:3192H F0AA LEA [ER10]
.l_05E:
2:3194H E3049A52 L ER10, 4:[EA+]
2:3198H FE8F NOP
2:319AH 88A8 SUB R8, R10
2:319CH 89B9 SUBC R9, R11
2:319EH EEFE ADD ER14, #7EH
2:31A0H C8F9 BNE .l_05E
2:31A2H 0E00 MOV R14, #00H
2:31A4H 0FE0 MOV R15, #E0H
2:31A6H EA00 MOV ER10, #00H
2:31A8H F0AA LEA [ER10]
.l_074:
2:31AAH E3059A52 L ER10, 5:[EA+]
2:31AEH FE8F NOP
2:31B0H 88A8 SUB R8, R10
2:31B2H 89B9 SUBC R9, R11
2:31B4H EEFE ADD ER14, #7EH
2:31B6H C8F9 BNE .l_074
2:31B8H 0EF6 MOV R14, #F6H
2:31BAH 0F1F MOV R15, #1FH
2:31BCH EA00 MOV ER10, #00H
2:31BEH F0AA LEA [ER10]
.l_08A:
2:31C0H E3079A52 L ER10, 7:[EA+]
2:31C4H FE8F NOP
2:31C6H 88A8 SUB R8, R10
2:31C8H 89B9 SUBC R9, R11
2:31CAH EEFE ADD ER14, #7EH
2:31CCH C8F9 BNE .l_08A
2:31CEH F085 MOV ER0, ER8
2:31D0H F83E POP QR8
2:31D2H F28E POP PCFC00H first bytes of segment 8, all bytes in segment 1 - 4, E000H first bytes of segment 5 and 1FF6H first bytes in segment 7 (edited)uint8_t stpacp = read_mem_data(&ctx->core, 0, 0xF008, 1);
if (ctx->stop_accept[0])
if (stpacp & 0xa0 == 0xa0 && ctx->stop_accept[1] == 0)
ctx->stop_accept[1] = 1;
else
ctx->stop_accept[0] = 0;
else if (stpacp & 0x50 == 0x50)
ctx->stop_accept[0] = 1; (edited) def sbycon(self):
sbycon = self.sim.sfr[9]
if sbycon & (1 << 1) and all(self.stop_accept):
self.stop_mode = True
self.stop_accept = [False, False]
self.sim.sfr[8] = 0
self.sim.sfr[9] = 0
self.sim.sfr[0x22] = 0
self.sim.sfr[0x23] = 0self.sim.sfr[9] = 0uint8_t sbycon = read_mem_data(&ctx->core, 0, 0xF009, 1);
if ((sbycon & (1 << 1)) && ctx->stop_accept[0] && ctx->stop_accept[1])
{
ctx->stop_mode = 1;
ctx->stop_accept[0] = 0;
ctx->stop_accept[1] = 0;
write_mem_data(&ctx->core, 0, 0xF008, 1, 0);
// write_mem_data(&ctx->core, 0, 0xF009, 1, 0);
write_mem_data(&ctx->core, 0, 0xF022, 1, 0);
write_mem_data(&ctx->core, 0, 0xF023, 1, 0);
} def timer(self):
if self.sim.sfr[0x25] & 1:
counter = (self.sim.sfr[0x23] << 8) + self.sim.sfr[0x22]
target = (self.sim.sfr[0x21] << 8) + self.sim.sfr[0x20]
counter = (counter + 1) & 0xffff
self.sim.sfr[0x22] = counter & 0xff
self.sim.sfr[0x23] = counter >> 8
if counter == target and self.stop_mode:
self.stop_mode = False
self.sim.sfr[9] &= ~(1 << 1)
self.sim.sfr[0x14] = 0x20
if not config.real_hardware:
for i in range(3):
if config.hardware_id == 0: self.sim.data_mem[0x800 + i] = 0
if config.hardware_id in (4, 5): self.sim.rw_seg[0x8e00 + i] = 0
else: self.sim.data_mem[0xe00 + i] = 0if (ctx->stop_mode) around the main stepping codeprintf("%s", ctx->stop_mode); before the step code? (edited)sbycon function?printf inside the sbycon if statement?/* */ package net.enderkitty.calc;
/* */
/* */ public class Timer {
/* */ private static final long NS_PER_SECOND = 1000000000L;
/* */ private static final long MAX_NS_PER_UPDATE = 1000000000L;
/* */ private static final int MAX_TICKS_PER_UPDATE = 100;
/* */ private double ticksPerSecond;
/* */ private long lastTime;
/* */ public int ticks;
/* */ public double a;
/* */ public double timeScale;
/* */ public double passedTime;
/* */
/* */ public Timer(double ticksPerSecond) {
/* 15 */ this.timeScale = 1.0D;
/* 16 */ this.passedTime = 0.0D;
/* 17 */ this.ticksPerSecond = ticksPerSecond;
/* 18 */ this.lastTime = System.nanoTime();
/* */ }
/* */
/* */ public void advanceTime() {
/* 22 */ long now = System.nanoTime();
/* 23 */ long passedNs = now - this.lastTime;
/* 24 */ this.lastTime = now;
/* 25 */ if (passedNs < 0L) {
/* 26 */ passedNs = 0L;
/* */ }
/* 28 */ if (passedNs > 1000000000L) {
/* 29 */ passedNs = 1000000000L;
/* */ }
/* */
/* 32 */ this.passedTime += passedNs * this.timeScale * this.ticksPerSecond / 1.0E9D;
/* 33 */ this.ticks = (int)this.passedTime;
/* 34 */ if (this.ticks > 100) {
/* 35 */ this.ticks = 100;
/* */ }
/* 37 */ this.passedTime -= this.ticks;
/* 38 */ this.a = this.passedTime;
/* */ }
/* */ }
/* Location: C:\Users\GWE\Download\Compressed\beucalc04b\beucalc.jar!\net\enderkitty\calc\Timer.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 1.1.3
*/
(decompiled beucalc code)printf inside the sbycon if statement? sbycon variable
2. the stop_accept arraysbycon variable
2. the stop_accept array stop_accept? stpacp = self.sim.sfr[8]
if self.stop_accept[0]:
if stpacp & 0xa0 == 0xa0 and not self.stop_accept[1]: self.stop_accept[1] = True
elif stpacp & 0x50 != 0x50: self.stop_accept[0] = False
elif stpacp & 0x50 == 0x50: self.stop_accept[0] = Truectx->stop_accept[x] to 1 add a printf("%s", ctx->stop_accept);?ctx->core.mem.regions[6] = (struct u8_mem_reg){
.type = U8_REGION_DATA,
.rw = false,
.addr_l = 0x80000,
.addr_h = 0x8FFFF,
.acc = U8_MACC_FUNC,
.read = &read_cb,
.write = &write_cb
};struct {
uint8_t (*read)(struct u8_core *, uint32_t);
void (*write)(struct u8_core *, uint32_t, uint8_t);
}; (edited)$ obj/wwce-dis 1200 12341234
0:1200 add r2, 0x34
0:1202 add r2, 0x34F310H is a solar power flagF310H to 0x10 (makes the calculator think it's receiving solar power) (edited)read_mem_data and write_mem_data if possible // uint8_t ready = read_mem_data(&ctx->core, 0, 0x8e00, 1); // this works
uint8_t ready = emu_kb[0]; // this doesn't // write_mem_data(&ctx->core, 0, 0x8e01, 1, keys[key_num].ki); // works
// write_mem_data(&ctx->core, 0, 0x8e02, 1, keys[key_num].ko); // works
emu_kb[1] = keys[key_num].ki; // also works
emu_kb[2] = keys[key_num].ko; // also works // uint8_t ready = read_mem_data(&ctx->core, 0, 0x8e00, 1); // this works
uint8_t ready = emu_kb[0]; // this doesn't data(0x8000, 0xE00, mem(ram)),
data(0x8e00, 0x30, mem(kbd)),
data(0xf000, 0x1000, mem(sfr)),
text(0, 0x8000, mem(code)),
code(0x8000, 0x8000, mem(code + 0x8000)),
text(0x10000, 0x10000, mem(code + 0x10000)),
rodata(0x80000, 0x10000, mem(code)), this is the working map // region 0 data
map(0x0'8000, 0x0'0e30, mem + 0x0'0000, component::MapType::Data);
map(0x0'f000, 0x0'1000, mem + 0x0'7000, component::MapType::Data);
// code segments
map(0x0'0000, 0x0'8000, rom + 0x0'0000, component::MapType::Both);
map(0x0'8000, 0x0'8000, rom + 0x0'8000, component::MapType::Code);
map(0x1'0000, 0x1'0000, rom + 0x1'0000, component::MapType::Both);
map(0x8'0000, 0x1'0000, rom + 0x0'0000, component::MapType::ROData); this is the broken one⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠀⠀⠀⠀⠀⠀⠀
⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀u8-emu-frontend but i still have it in simu8-frontend3:0038H in fx-880BTG emu romMOV ER0, #-1 (edited)MOV ER0, #-1 is correct now but attempts is still 0 (edited)c++
for (size_t y = 0; y < m_height; y++) {
for (size_t x = 0; x < m_width; x += 8) {
uint8_t byte = mem[x / 8 + y * m_width / 8];
printf("px %d\n", x / 8 + y * m_width / 8);
for (size_t xb = 0; xb < 8; xb++) {
_updatePixel(x + xb, y, (byte << xb) & 0x80);
}
}
}c++
inline void operator++() {
do {
auto h = (ImageItem*)m_addr;
m_addr += h->m_paylen + 8;
if (this->operator*().m_tag == Tag::compatible) {
auto& ent = this->operator*();
if (ent.m_paylen != strlen(compatible)) {
printf("E: incompatible rom8 file\n");
exit(1);
}
if (memcmp(ent.m_pay, compatible, ent.m_paylen)) {
printf("E: incompatible rom8 file\n");
exit(1);
}
} else {
break;
}
} while (true);
}c++
inline void operator++() {
do {
auto h = (ImageItem*)m_addr;
m_addr += h->m_paylen + 8;
if (this->operator*().m_tag == Tag::compatible) {
auto& ent = this->operator*();
if (ent.m_paylen != strlen(compatible)) {
printf("E: incompatible rom8 file\n");
exit(1);
}
if (memcmp(ent.m_pay, compatible, ent.m_paylen)) {
printf("E: incompatible rom8 file\n");
exit(1);
}
} else {
break;
}
} while (true);
} c++
inline void operator++() {
do {
auto h = (ImageItem*)m_addr;
m_addr += h->m_paylen + 8;
if (this->operator*().m_tag == Tag::compatible) {
auto& ent = this->operator*();
if (ent.m_paylen != strlen(compatible)) {
printf("E: incompatible rom8 file\n");
exit(1);
}
if (memcmp(ent.m_pay, compatible, ent.m_paylen)) {
printf("E: incompatible rom8 file\n");
exit(1);
}
} else {
break;
}
} while (true);
}
; IN: inode in si
read_inode:
pushad ; sorry
; calculate group and index
dec si
mov ax, si
xor dx, dx
mov cx, getw(0x8000, s_inodes_per_group)
div cx
; sign extend
movzx eax, ax
movzx edx, dx
; ax: ino_blk_grp
; dx: ino_tbl_idx
; read the block group info thingy
pushad
shr eax, 4
; calculate 1 << extshift into ebx
mov ebx, 1
mov cl, [extshift]
shl ebx, cl
; smol volumes' bgd starts later
mov edx, 4
cmp ebx, 2
cmove ebx, edx
; make sure to offset it
add eax, ebx
; now, load!
mov edi, 0x8200
diskload eax
popad
; should we use inode256?
cmp getw(0x8000, s_inode_size), 0x100
je read_inode256
; keep going in the 2nd sector
jmp read_inode_secondsecc++
virtual void loadRomData(rom8::File& file) {
for (auto& rdat : file) {
if (rdat.m_tag == rom8::Tag::rom) {
if (rdat.m_paylen != 0x20000) {
printf("E: rom size invalid\n");
exit(1);
}
m_rom = rdat.m_pay;
}
if (rdat.m_tag == rom8::Tag::calcType) {
if (rdat[0] != (0x1 | 0x4)) {
printf("E: rom for invalid calculator type (byte: %d)\n", rdat[0]);
exit(1);
}
}
}
}c++
virtual void loadRomData(rom8::File& file) {
for (auto& rdat : file) {
if (rdat.m_tag == rom8::Tag::rom) {
if (rdat.m_paylen != 0x20000) {
printf("E: rom size invalid\n");
exit(1);
}
m_rom = rdat.m_pay;
}
if (rdat.m_tag == rom8::Tag::calcType) {
if (rdat[0] != (0x1 | 0x4)) {
printf("E: rom for invalid calculator type (byte: %d)\n", rdat[0]);
exit(1);
}
}
}
} F008H0x5x byte is written then followed by 0xAx, in that exact orderF009H (SBYCON) is set which enables stop mode (edited)F020H and F022H, they are the target and counter respectivelyc++
if (core->rd(0xf009) == 1) {
printf("in STOP\n");
uint16_t sleep_for = core->r16(0xf020);
// SBYCON.STP = 1, don't run
if (kc == 0xff) return false;
uint8_t ki = 1 << (kc >> 4);
uint8_t ko = 1 << (kc & 0xf);
core->wr(0x8e01, ki);
core->wr(0x8e02, ko);
return true;
}F009H07e34
07e20
07e22
07e24
07e26
07e28
07e2a
07e2c
07e2e
07e30
07e32
07e34Indirect leak of 128 byte(s) in 1 object(s) allocated from:
#0 0xaaaac3770664 in malloc (/home/pitust/code/wwce/obj/wwce-emu+0x120664) (BuildId: 5603a0b12af8ffebacf5aa038b4acd1df7e6b85d)
#1 0xfffefe488560 (/usr/lib/dri/asahi_dri.so+0xb8560) (BuildId: 1cee5509f46ffcd296c2e9657eec38039990feb4)
#2 0xfffefeb17a34 (/usr/lib/dri/asahi_dri.so+0x747a34) (BuildId: 1cee5509f46ffcd296c2e9657eec38039990feb4)
#3 0xfffefebad424 (/usr/lib/dri/asahi_dri.so+0x7dd424) (BuildId: 1cee5509f46ffcd296c2e9657eec38039990feb4)
#4 0xfffefeb70d44 (/usr/lib/dri/asahi_dri.so+0x7a0d44) (BuildId: 1cee5509f46ffcd296c2e9657eec38039990feb4)
#5 0xfffefeb8a8d8 (/usr/lib/dri/asahi_dri.so+0x7ba8d8) (BuildId: 1cee5509f46ffcd296c2e9657eec38039990feb4)
#6 0xfffefeb8ad7c (/usr/lib/dri/asahi_dri.so+0x7bad7c) (BuildId: 1cee5509f46ffcd296c2e9657eec38039990feb4)
#7 0xfffefeb5c308 (/usr/lib/dri/asahi_dri.so+0x78c308) (BuildId: 1cee5509f46ffcd296c2e9657eec38039990feb4)
#8 0xfffefeb53b40 (/usr/lib/dri/asahi_dri.so+0x783b40) (BuildId: 1cee5509f46ffcd296c2e9657eec38039990feb4)
#9 0xfffefeb614f0 (/usr/lib/dri/asahi_dri.so+0x7914f0) (BuildId: 1cee5509f46ffcd296c2e9657eec38039990feb4) (edited)07e34
07e20
07e22
07e24
07e26
07e28
07e2a
07e2c
07e2e
07e30
07e32
07e34 0:37E4H F00CF008 LEA F008H
0:37E8H 0250 MOV R2, #50H
0:37EAH 03A0 MOV R3, #A0H
0:37ECH 9231 ST R2, [EA]
0:37EEH 9351 ST R3, [EA+]
0:37F0H 0002 MOV R0, #02H
0:37F2H 9031 ST R0, [EA]
0:37F4H FE8F NOP
0:37F6H FE8F NOP0:37E4H F00CF008 LEA F008H
0:37E8H 0250 MOV R2, #50H
0:37EAH 03A0 MOV R3, #A0H
0:37ECH 9231 ST R2, [EA]
0:37EEH 9351 ST R3, [EA+]
0:37F0H 0002 MOV R0, #02H
0:37F2H 9031 ST R0, [EA]
0:37F4H FE8F NOP
0:37F6H FE8F NOP c++
if (core->rd(0xf009)) {
kc = face->update(core->m_mem + 0x7800);
os::sleep(1'000'000);
core->wr(0xf009, 0);
core->w16(0xf020, 0);
return true;
} def timer(self):
now = time.time_ns()
passed_ns = now - self.last_time
self.last_time = now
if passed_ns < 0: passed_ns = 0
elif passed_ns > self.max_ns_per_update: passed_ns = 0
self.passed_time += passed_ns * self.tps / self.nsps
ticks = int(self.passed_time) if self.passed_time < 100 else 100
self.passed_time -= ticks
self.timer_tick(ticks)__init__
self.nsps = 1e9
self.max_ns_per_update = 1e9
self.max_ticks_per_update = 100
self.tps = 10000
self.last_time = 0
self.passed_time = 0bad access 0:9838
bad access 0:9804
bad access 0:9805
bad access 0:9806
bad access 0:9807
bad access 0:9808
bad access 0:9809
bad access 0:980a
bad access 0:980b
bad access 0:980c
bad access 0:980d
bad access 0:980e
bad access 0:980f
bad access 0:9810
bad access 0:9811
bad access 0:9812
bad access 0:9813
(...)src/tool8.py wrap_rom_emu --rom rom_emu.bin --face ~/Downloads/fx83gtplus-quality.png --dispx 66 --dispy 139 --dispscale 3 --gridfiles ignore/ag.bin --out roms/fx83_gtplus_emu.rom8 noting down command used to make the rom8mem: w 0f020 => 0x13
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0x12
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0x11
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0x10
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0xf
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0xe
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0xd
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0xc
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0xb
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0xa
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0x9
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0x8
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0x7
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0x6
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0x5
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0x4
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0x3
mem: w 0f021 => 0
mem: r 0f020 => 0
mem: r 0f021 => 0
mem: w 0f020 => 0x2
mem: w 0f021 => 0model rom8 proprun()
to
if __name__ == '__main__': run()compatible tags are used in one file? for now i'll just make it an errorprop, rom, and facePNG) (edited)struct DisplayBounds {
/* 0x00 */ uint16_t x;
/* 0x02 */ uint16_t y;
/* 0x04 */ uint16_t width;
/* 0x06 */ uint16_t height;
/* 0x08 */ uint16_t scale;
}
the tool8 script appears to write width and height first...faceKeybinds to the ROM8Tag enumscompatible tags are used in one file? for now i'll just make it an error struct DisplayBounds {
/* 0x00 */ uint16_t x;
/* 0x02 */ uint16_t y;
/* 0x04 */ uint16_t width;
/* 0x06 */ uint16_t height;
/* 0x08 */ uint16_t scale;
}
the tool8 script appears to write width and height first... struct DisplayBounds {
/* 0x00 */ uint16_t x;
/* 0x02 */ uint16_t y;
/* 0x04 */ uint16_t width;
/* 0x06 */ uint16_t height;
/* 0x08 */ uint16_t scale;
}
the tool8 script appears to write width and height first... 0x98xx (edited) if (ready == 2) {
if (m_kc != 0x24) {
core->wr(0x8e00, 0);
m_ready = 0;
return true;
}
}8E00H to EFFFH read onlyF014H (IRQ0)8E00H to EFFFH read only enum EmuRequest {
GetKey = 1,
ACBreak = 2,
Shutdown = 3,
ddSomething = 4,
StartQR11 = 5,
StopQR = 6,
StartQR3 = 7,
ACBreak2 = 8,
};enum EmuRequest {
GetKey = 1,
ACBreak = 2,
Shutdown = 3,
ddSomething = 4,
StartQR11 = 5,
StopQR = 6,
StartQR3 = 7,
ACBreak2 = 8,
}; IM_EY.ES_STOP_GETKEY = 0x01 // �L�[�҂�
IM_EY.ES_STOP_ACBREAK = 0x02 // AcBreak�`�F�b�N
IM_EY.ES_STOP_DOOFF = 0x03 // OFF
IM_EY.ES_STOP_DDOUT = 0x04 // DD �\��
IM_EY.ES_STOP_QRCODE_IN = 0x05 // QR Ver.11 �J�n�iURL����������j
IM_EY.ES_STOP_QRCODE_OUT = 0x06 // QR �I��
IM_EY.ES_STOP_QRCODE_IN3 = 0x07 // QR Ver.3 �J�n�iURL����������j
IM_EY.ES_STOP_ACBREAK2 = 0x08 // AcBreak�`�F�b�N <SRC_15270_ACBreakWithDD>IM_EY.ES_STOP_GETKEY = 0x01 // �L�[�҂�
IM_EY.ES_STOP_ACBREAK = 0x02 // AcBreak�`�F�b�N
IM_EY.ES_STOP_DOOFF = 0x03 // OFF
IM_EY.ES_STOP_DDOUT = 0x04 // DD �\��
IM_EY.ES_STOP_QRCODE_IN = 0x05 // QR Ver.11 �J�n�iURL����������j
IM_EY.ES_STOP_QRCODE_OUT = 0x06 // QR �I��
IM_EY.ES_STOP_QRCODE_IN3 = 0x07 // QR Ver.3 �J�n�iURL����������j
IM_EY.ES_STOP_ACBREAK2 = 0x08 // AcBreak�`�F�b�N <SRC_15270_ACBreakWithDD> ESHardInformationCY.js (classpad)
// ����STOP�����̃f�[�^ - What STOP Middle Data
export const ES_STOP_GETKEY = 0x01 // �L�[�҂� - Waiting for keys
export const ES_STOP_ACBREAK = 0x02 // AcBreak�`�F�b�N - ACBREAK check
export const ES_STOP_DOOFF = 0x03 // OFF
export const ES_STOP_DDOUT = 0x04 // DD �\�� - DD display
export const ES_STOP_QRCODE_IN = 0x05 // QR Ver.11 �J�n�iURL����������j- QR Ver.11 start (URL also comes in)
export const ES_STOP_QRCODE_OUT = 0x06 // QR �I�� - QR end
export const ES_STOP_QRCODE_IN3 = 0x07 // QR Ver.3 �J�n�iURL����������j- QR Ver. 3 start (URL comes in)
export const ES_STOP_ACBREAK2 = 0x08 // AcBreak�`�F�b�N <SRC_15270_ACBreakWithDD> - ACBREAK checkTraceback (most recent call last):
File "C:\Users\user\Desktop\casio\u8-emu-frontend\main.py", line 1467, in <module>
sim = Sim()
File "C:\Users\user\Desktop\casio\u8-emu-frontend\main.py", line 799, in __init__
tags = list(tool8.read8(config.rom_file))
File "C:\Users\user\Desktop\casio\u8-emu-frontend\tool8\tool8.py", line 68, in read8
assert pay == SUPPORTED_ROM8 (edited)Traceback (most recent call last):
File "C:\Users\user\Desktop\casio\u8-emu-frontend\main.py", line 1467, in <module>
sim = Sim()
File "C:\Users\user\Desktop\casio\u8-emu-frontend\main.py", line 799, in __init__
tags = list(tool8.read8(config.rom_file))
File "C:\Users\user\Desktop\casio\u8-emu-frontend\tool8\tool8.py", line 68, in read8
assert pay == SUPPORTED_ROM8 (edited)cat command that lets you merge (and update) rom8 files (edited)c++
if (kc == 0xff) {
KI(core, 0);
} else {
if (KO(core) & ko) {
KI(core, ki);
} else {
KI(core, 0);
}
}bad access 4:98381:d28a dsr.r r0
1:d28c st r1, [er12]var boards in
var board in
var ident 0x05
var romSegments 0x2
var mapOld nil
var sfr in
const REG_BASE 0x8e00
var pvReq REG_BASE + 0
var pvKI REG_BASE + 1
var pvKO REG_BASE + 2
end
end
var board in
var ident 0x06
var romSegments 0x4
var mapCW nil
var sfr in
const REG_BASE 0x48e00
var pvReq REG_BASE + 0
var pvKI REG_BASE + 1
var pvKO REG_BASE + 2
end
end
end7:1FEEH iircF800H are the low bits8:9000H that holds the high bits (edited)8:9000H that holds the high bits (edited) screen_data = [[(2 if scr_bytes_hi[1+i][j] & (1 << k) > 0 else 0) + (1 if scr_bytes_lo[1+i][j] & (1 << k) else 0) for j in range(0x18) for k in range(7, -1, -1)] for i in range(63)]c++
map(0x0'0000, 0x0'd000, rom + 0x0'0000, component::MapType::ROData);
map(0x0'd000, 0x0'3000, mem + 0x0'0000, component::MapType::Data);
map(0x1'0000, 0x1'0000, rom + 0x1'0000, component::MapType::ROData);
map(0x2'0000, 0x1'0000, rom + 0x2'0000, component::MapType::ROData);
map(0x3'0000, 0x1'0000, rom + 0x3'0000, component::MapType::ROData);
map(0x4'0000, 0x1'0000, mem + 0x1'0000, component::MapType::Data);
map(0x5'0000, 0x1'0000, rom + 0x0'0000, component::MapType::ROData);SimU8.dll instead of writing everything from ground up.SimU8.dll instead of writing everything from ground up. casio.log in same directory as DLL and then orginal dll will log all cpu stepscasio.log in same directory as DLL and then orginal dll will log all cpu steps E800HMaxAddrCodeSetCodeMemorySize which as you said before not always are accurate.MaxAddrCode addressSetPeriBCD(1) has a comment that says enable BCD supportF4xxH SFRs yetSetPeriBCD wasm function (i got it from chrome devtools)
(func $Q (;377;) (export "Q") (param $var0 i32) (result i32)
(local $var1 i32)
(local $var2 i32)
i32.const 26840 (; 0x68D8 ;)
i32.load8_u
i32.const 0
i32.ne
i32.const 26844 (; 0x68DC ;)
i32.load
i32.const -1
i32.ne
i32.and
if (result i32)
i32.const 24
local.set $var2
block $label2
block $label0
block $label1
local.get $var0
br_table $label0 $label1 $label2
end $label1
i32.const 1
local.set $var1
end $label0
i32.const 24104 (; 0x5E28 ;)
local.get $var1
i32.store8
i32.const 0
local.set $var2
end $label2
local.get $var2
else
i32.const -1
end
) (edited)DAA Rn and DAS Rn and that is really all in documentation having BCD in text
/* private: void __thiscall CSimU8main::nmice_int(unsigned short,int) */
void __thiscall CSimU8main::nmice_int(CSimU8main *this,ushort param_1,int param_2)
{
/* 0x1497 145 ?nmice_int@CSimU8main@@AAEXGH@Z */
switch(param_2) {
case 0:
*(undefined4 *)(this + 0x20a8) = 1;
*(undefined4 *)(this + 0x21f4) = 1;
*(undefined4 *)(this + 0x2190) = 1;
*(undefined4 *)(this + 0x2244) = 1;
*(undefined4 *)(this + 0x2204) = 1;
*(undefined4 *)(this + 0x22bc) = 1;
*(undefined4 *)(this + 0x22c0) = 1;
*(undefined4 *)(this + 0x20b0) = 0;
return;
case 1:
*(undefined4 *)(this + 0x2128) = 1;
*(undefined4 *)(this + 0x2160) = 1;
*(undefined4 *)(this + 0x20b0) = 0;
return;
case 2:
*(undefined4 *)(this + 0x21dc) = 1;
*(undefined4 *)(this + 0x21f8) = 1;
*(undefined4 *)(this + 0x2190) = 1;
*(undefined4 *)(this + 0x2240) = 1;
*(undefined4 *)(this + 0x2250) = 1;
break;
case 3:
*(undefined4 *)(this + 0x20d8) = 1;
*(undefined4 *)(this + 0x20ac) = 1;
break;
default:
goto switchD_10015fef_exit;
}
*(undefined4 *)(this + 0x2168) = 1;
*(undefined4 *)(this + 0x20b0) = 0;
switchD_10015fef_exit:
return;
}this/* private: void __thiscall CSimU8main::software_int(unsigned short,int) */
void __thiscall CSimU8main::software_int(CSimU8main *this,ushort param_1,int param_2)
{
/* 0x187f 149 ?software_int@CSimU8main@@AAEXGH@Z */
if (param_2 == 0) {
*(undefined4 *)(this + 0x20a8) = 1;
*(undefined4 *)(this + 0x2180) = 1;
*(undefined4 *)(this + 0x21b8) = 1;
*(undefined4 *)(this + 0x21f4) = 1;
*(undefined4 *)(this + 0x2244) = 1;
*(undefined4 *)(this + 0x22ac) = 1;
*(undefined4 *)(this + 0x2204) = 1;
*(undefined4 *)(this + 0x22b0) = 1;
}
else {
if (param_2 != 1) {
if (param_2 != 2) {
return;
}
*(undefined4 *)(this + 0x2168) = 1;
*(undefined4 *)(this + 0x20d8) = 1;
*(undefined4 *)(this + 0x20ac) = 1;
*(undefined4 *)(this + 0x20b0) = 0;
return;
}
*(undefined4 *)(this + 0x2168) = 1;
*(undefined4 *)(this + 0x2248) = 1;
*(undefined4 *)(this + 0x21dc) = 1;
*(undefined4 *)(this + 0x21f8) = 1;
*(undefined4 *)(this + 0x2240) = 1;
}
*(undefined4 *)(this + 0x2190) = 1;
*(undefined4 *)(this + 0x20b0) = 0;
return;
}SimU8engine.dllSetPeriBCD in SimU8engine.dll 2.10.1.0 (code from ghidra):
int __thiscall CSimU8core::m_SetPeriBCD(CSimU8core *this,char enable)
{
/* 0x40d0 41 ?m_SetPeriBCD@CSimU8core@@QAEHE@Z */
if (enable == '\0') {
(**(code **)(*(int *)(this + 0x80) + 8))(0);
return 0;
}
if (enable == '\x01') {
(**(code **)(*(int *)(this + 0x80) + 8))(1);
return 0;
}
return 0x18;
} (edited)void set_peri_bcd(CSimU8core *this,int enable)
{
this[4] = enable._0_1_;
return;
}PC 046a4 r 0x0f042 (1: 00)
PC 046ac w 0x0f024 (2: 0f)
PC 046b2 w 0x0f022 (2: 00)
PC 046c0 w 0x0f025 (1: 01)
PC 04670 w 0x0f024 (2: 01)
PC 04676 w 0x0f022 (2: 00)
PC 04680 w 0x0f025 (1: 01)PC 0469c r 0x0f046 (1: 00)
PC 0469c w 0x0f040 (1: ff)
PC 046a4 r 0x0f042 (1: 00)
PC 046ac w 0x0f024 (2: 0f)
PC 046b2 w 0x0f022 (2: 00)
PC 046c0 w 0x0f025 (1: 01)
PC 1d232 w 0x0f037 (1: 00)
PC 1d22a w 0x0f037 (1: 04)
PC 1d232 w 0x0f037 (1: 00)
PC 1d22a w 0x0f037 (1: 04)
PC 1d232 w 0x0f037 (1: 00)
PC 1d22a w 0x0f037 (1: 04)
PC 04670 w 0x0f024 (2: 01)
PC 04676 w 0x0f022 (2: 00)
PC 04680 w 0x0f025 (1: 01)branch on X then branch on not Xinput length * 11 + 0x202 (edited)$ obj/wwce-emu -image roms/CY213.rom8
E: this rom type is not supported my new emu build system is so greatE: wwce was built without librsvg and libcairo
W: display offsets were set even though no display data is present.
I: calc display 192x64
STOP 80
STOP EXIT
STOP 1480
STOP EXIT
STOP 1
STOP EXIT
zsh: floating point exception (core dumped) obj/wwce-emu -image roms/CY213.rom8 -conf src/inter/board.portable.cfgDownloading separate debug info for /usr/lib/libLLVM-16.so why debuginfod is very useful (not) (edited)c++
0x0000555555576828 in Registrator<component::Core>::factory (this=0x5555555b0e60 <s_core_reg>, preferred=0x0) at src/lib/entry.cc:43
43 return m_reg[0].m_fac(); quality codeThread 1 "wwce-emu" received signal SIGFPE, Arithmetic exception.
0x0000555555584eb2 in instr_div (core=0x7fffffffdeb8, flags=0 '\000', op0=0x7fffffffde70, op1=0x7fffffffde58) at third_party/u8_emu/src/core/instr_impl.c:653
653 uint64_t res = val0 / val1;#0 0x0000555555584eb2 in instr_div (core=0x7fffffffdeb8, flags=0 '\000', op0=0x7fffffffde70, op1=0x7fffffffde58) at third_party/u8_emu/src/core/instr_impl.c:653
#1 0x0000555555569eb5 in u8_step (core=0x7fffffffdeb8) at third_party/u8_emu/src/core/core.c:42
#2 0x0000555555580ec7 in (anonymous namespace)::U8Emu::step() (this=0x7ffff7fa3010) at src/inter/core.u8emu.cc:55
#3 0x000055555555a808 in entrypoint() () at src/emu.cc:28
#4 0x000055555555a710 in main(int, char**) (argc=5, argv=0x7fffffffe098) at src/emu.cc:13 (edited)c++
==388057==ERROR: AddressSanitizer: FPE on unknown address 0x55f41327cac2 (pc 0x55f41327cac2 bp 0x7ffd8cee2560 sp 0x7ffd8cee2520 T0)
#0 0x55f41327cac2 (/home/pitust/code/wwce/obj/wwce-emu+0x33bac2) (BuildId: 165a92c527c79e3240e093729c4e7f308192fa85)
#1 0x55f41327a3c4 (/home/pitust/code/wwce/obj/wwce-emu+0x3393c4) (BuildId: 165a92c527c79e3240e093729c4e7f308192fa85)
#2 0x55f4131311e5 (/home/pitust/code/wwce/obj/wwce-emu+0x1f01e5) (BuildId: 165a92c527c79e3240e093729c4e7f308192fa85)
#3 0x55f41311a736 (/home/pitust/code/wwce/obj/wwce-emu+0x1d9736) (BuildId: 165a92c527c79e3240e093729c4e7f308192fa85)
#4 0x55f4131198a7 (/home/pitust/code/wwce/obj/wwce-emu+0x1d88a7) (BuildId: 165a92c527c79e3240e093729c4e7f308192fa85)
#5 0x7f710460dccf (/usr/lib/libc.so.6+0x27ccf) (BuildId: 8bfe03f6bf9b6a6e2591babd0bbc266837d8f658)
#6 0x7f710460dd89 (/usr/lib/libc.so.6+0x27d89) (BuildId: 8bfe03f6bf9b6a6e2591babd0bbc266837d8f658)
#7 0x55f412fe0574 (/home/pitust/code/wwce/obj/wwce-emu+0x9f574) (BuildId: 165a92c527c79e3240e093729c4e7f308192fa85) stpacp = self.sim.sfr[8]
if self.stop_accept[0]:
if stpacp & 0xa0 == 0xa0 and not self.stop_accept[1]: self.stop_accept[1] = True
elif stpacp & 0x50 != 0x50: self.stop_accept[0] = False
elif stpacp & 0x50 == 0x50: self.stop_accept[0] = True stpacp = self.sim.sfr[8]
if self.stop_accept[0]:
if not self.stop_accept[1]:
if stpacp & 0xa0 == 0xa0: self.stop_accept[1] = True
elif stpacp & 0x50 != 0x50: self.stop_accept[0] = False
elif stpacp & 0x50 == 0x50: self.stop_accept[0] = True:020100001200EB
:00000001FF
this is the hex filestrcpy that copies null-terminated data from segment 2 to data segment 0 (00:8000H)2:0000HSetPeriBCD is indeed somehow related to the F4xxH SFRsSetPeriBCD(1) to SetPeriBCD(0) in simwrapper.js i got 1+1=00x3020 in SimU8engine.dllEY-001 V.A Bt OK SUM8585 NG 000000000000BCDRST 0x0f402
BCDOP 0x0f400
BCDRAM 0x0f480
this is what i think the regs aref_1B6CE in fx-82CW (EY-001A) emu rom rnf_1B6CE in fx-82CW (EY-001A) emu rom rn EY-001 V.A Bt OK SUM8585 NG 000000000000 status_bar_crops = (
(0, 0, 8, 10), # [S]
(9, 0, 9, 10), # [A]
(21, 0, 8, 9), # M
(32, 0, 17, 10), # STO
(50, 0, 17, 10), # RCL
(70, 0, 21, 10), # STAT
(91, 0, 32, 10), # CMPLX
(123, 0, 19, 9), # MAT
(142, 0, 17, 10), # VCT
(161, 0, 9, 10), # [D]
(170, 0, 9, 10), # [R]
(180, 0, 9, 10), # [G]
(192, 0, 14, 9), # FIX
(206, 0, 14, 10), # SCI
(224, 0, 23, 10), # Math
(249, 0, 9, 9), # v
(258, 0, 9, 9), # ^
(268, 0, 19, 11), # Disp
)status_bar_crops = (
(0, 0, 9, 10), # [S]
(13, 0, 9, 10), # [A]
(26, 0, 9, 9), # M
(38, 0, 19, 10), # STO
(60, 0, 19, 10), # RCL
(81, 0, 24, 10), # STAT
(108, 0, 19, 10), # 360
(129, 0, 10, 10), # SI
(142, 0, 23, 9), # DMY
(168, 0, 10, 10), # [D]
(178, 0, 10, 10), # [R]
(188, 0, 10, 10), # [G]
(202, 0, 16, 9), # FIX
(218, 0, 16, 10), # SCI
(0, 0, 0, 0), # (blank)
(246, 0, 8, 9), # v
(254, 0, 9, 9), # ^
(266, 0, 22, 11), # Disp
)status_bar_crops = (
(1, 1, 19, 20),
(25, 1, 19, 20),
(53, 2, 17, 18),
(83, 2, 25, 19),
(121, 2, 40, 18),
(172, 1, 19, 20),
(193, 1, 19, 20),
(214, 1, 19, 20),
(244, 2, 36, 18),
(284, 2, 34, 18),
(330, 2, 17, 18),
(358, 1, 10, 19),
(375, 2, 18, 17),
(398, 2, 20, 18),
(428, 3, 16, 15),
(449, 3, 17, 15),
(470, 3, 17, 15),
(492, 3, 16, 15),
(518, 1, 23, 19),
(551, 0, 23, 23),
)(tl_x, tl_y, width, height)zsh: segmentation fault (core dumped) obj/wwce-conftest -conf [ var a nil ] high quality emulatorgit clone --recursive https://u8.malwarez.xyz/git/wwce -b trunk./x againVIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 18 2023 04:12:26)VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Aug 18 2023 04:12:26) xxd 2021-10-22 by Juergen Weigert et al.apt upgrade times = ['obj/config.o'] => s = []echo $WAYLAND_DISPLAY $DISPLAY wayland-0 :0mold to make linking fastervoid instr_div(struct u8_core *core, uint8_t flags, struct u8_oper *op0, struct u8_oper *op1) {
uint64_t val0 = oper_read(core, op0);
uint64_t val1 = oper_read(core, op1);
core->regs.psw &= 0b00111111;
uint64_t res = val0 / val1;
if (val1 == 0) core->regs.psw |= 0b10000000;
if (res == 0) core->regs.psw |= 0b01000000;
oper_write(core, op0, res);
oper_write(core, op1, val0 % val1);
}git submodule sync --recursive-b trunk alsogit clone --recursive https://u8.malwarez.xyz/git/wwceexample@example.com?./x script to cooperatesrc/lib/os.posix.cc (edited)src/inter/con.tty.cc./x nconfgit@git.malwarez.xyz:~pitust/wwce (edited)LARGE memory model?LARGESetMemoryModel so probably they care in some way, however i think that if you set large memory model and run code which is prepared for SMALL it will work anywaySetMemoryModel so probably they care in some way, however i think that if you set large memory model and run code which is prepared for SMALL it will work anyway 0x9000 and you will find RAM (edited)goto 9000 if using cwiigoto d000e.caduo.eu.org/<stuff after> redirect to e.20142022.xyz/<stuff after>https://e.caduo.eu.org/rebuild?model=EY023 to go straight to emulatorvar imgLoad in
var calcType 0x06
var displayOptions in
var x 86 var y 108
var w 192 var h 63
var scale 3
end
var model "CY000 (emu)"
var rom in var path "roms/blob/rom.bin" end
var faceSVG in var path "roms/blob/face.svg" end
endE: cannot open file (null): Bad address
quality parsing U abort
U __ctype_b_loc
U __ctype_tolower_loc
U __cxa_atexit
U __errno_location
U exit
U fopen
U fread
U free
U fseek
U ftell
U __libc_start_main
U malloc
U memcmp
U memcpy
U memset
U printf
U __progname_full
U program_invocation_name
U realloc
U __stack_chk_fail
U __stack_chk_guard
U strchr
U strcmp
U strdup
U strerror
U strlen
U strncmp
U usleep
U operator delete[](void*)
U operator delete(void*)
U operator new[](unsigned long)
U operator new(unsigned long)F040H (inverted) (edited)F046H for GYX and later, and F044H (inverted) for GY- and earlier==23461==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete) on 0x60300001bc10 #1 0xffff3cb95f8c (/usr/lib/libLLVM-16.so+0xfd5f8c) (BuildId: 643dbef070e1ff6af10c347a75d9daaa4f8b5180)gwe@zero:~/Documents/wwce$ ./x
[1/3] cxx src/lib/char-tables.cc
[2/3] cxx src/gentool/pc.cc
FAILED: obj/prepare/src/gentool/pc.cc.o
clang++ -c -o obj/prepare/src/gentool/pc.cc.o src/gentool/pc.cc -MD -MF obj/prepare/src/gentool/pc.cc.o.d -Iinc -ggdb -fno-exceptions -fno-rtti -Iinc -std=c++2a -DUSE_PREPARE_SIMPLIFIED -I/usr/include/pkgconf
src/gentool/pc.cc:13:11: error: no matching function for call to 'pkgconf_client_new'
auto c = pkgconf_client_new(handlePCErr, nullptr, pkgconf_cross_personality_default());
^~~~~~~~~~~~~~~~~~
/usr/include/pkgconf/libpkgconf/libpkgconf.h:209:32: note: candidate function not viable: no known conversion from 'bool (const char *, const pkgconf_client_t *, void *)' (aka 'bool (const char *, const pkgconf_client_ *, void *)') to 'pkgconf_error_handler_func_t' (aka 'bool (*)(const char *, const pkgconf_client_ *, const void *)') for 1st argument
PKGCONF_API pkgconf_client_t * pkgconf_client_new(pkgconf_error_handler_func_t error_handler, void *error_handler_data, const pkgconf_cross_personality_t *personality);
^
src/gentool/pc.cc:24:11: error: no matching function for call to 'pkgconf_client_new'
auto c = pkgconf_client_new(handlePCErr, nullptr, pkgconf_cross_personality_default());
^~~~~~~~~~~~~~~~~~
/usr/include/pkgconf/libpkgconf/libpkgconf.h:209:32: note: candidate function not viable: no known conversion from 'bool (const char *, const pkgconf_client_t *, void *)' (aka 'bool (const char *, const pkgconf_client_ *, void *)') to 'pkgconf_error_handler_func_t' (aka 'bool (*)(const char *, const pkgconf_client_ *, const void *)') for 1st argument
PKGCONF_API pkgconf_client_t * pkgconf_client_new(pkgconf_error_handler_func_t error_handler, void *error_handler_data, const pkgconf_cross_personality_t *personality);
^
2 errors generated.
ninja: build stopped: subcommand failed.void* with const void* in handlePCErrvoid* with const void* in handlePCErr gwe@zero:~/Documents/wwce$ ./x
[1/10] cxx src/lib/string.cc
[2/10] cxx src/lib/opt.cc
[3/10] cxx src/lib/os.posix.cc
[4/10] cxx src/lib/char-tables.cc
[5/10] cxx src/gentool/pc.cc
FAILED: obj/prepare/src/gentool/pc.cc.o
clang++ -c -o obj/prepare/src/gentool/pc.cc.o src/gentool/pc.cc -MD -MF obj/prepare/src/gentool/pc.cc.o.d -Iinc -ggdb -fno-exceptions -fno-rtti -Iinc -std=c++2a -DUSE_PREPARE_SIMPLIFIED -I/usr/include/pkgconf
src/gentool/pc.cc:37:7: error: use of undeclared identifier 'pkgconf_queue_solve'
if (!pkgconf_queue_solve(c, &pkgq, &world, 10000)) {
^
src/gentool/pc.cc:39:3: error: use of undeclared identifier 'pkgconf_solution_free'
pkgconf_solution_free(c, &world);
^
src/gentool/pc.cc:56:2: error: use of undeclared identifier 'pkgconf_solution_free'
pkgconf_solution_free(c, &world);
^
3 errors generated.
[6/10] cxx src/gentool/config.cc
[7/10] cxx src/gentool/conf-kconfig.cc
[8/10] cxx src/lib/entry.cc
[9/10] cxx src/gentool/main.cc
ninja: build stopped: subcommand failed.autoreconf -fi in pkgconf repo and it says autoreconf >= 2.71 is requiredbake?$ obj/wwce-toconf roms/CY000-emu.rom8 -blob roms/blobs
var imgLoad in
var calcType 0x06
var displayOptions in
var x 80 var y 89
var w 192 var h 63
var scale 3
end
var model "CY000 (emu)"
var rom in var path "roms/blobs/rom.bin" end
var faceSVG in var path "roms/blobs/face.svg" end
// whatever (edited)-blobmissing os::sleep
missing os::createThread
missing os::pollfd
missing os::mstime
missing os::readFile
missing os::writeFile
missing os::freeData
missing os::exit
missing os::fail
missing os::intr
missing os::dir
missing os::probemissing os::sleep
missing os::createThread
missing os::pollfd
missing os::mstime
missing os::probe actually all of these 1 0x0040ebd1 oper_imm+0x181(core=<internal error>, oper=<internal error>, val=<internal error>) [Z:\home\pitust\code\wwce\third_party\u8_emu\src\core\instr.c:271] in wwce-emu (0x0151fd10) (edited)=>0 0x0040ebd1 oper_imm+0x181(core=<internal error>, oper=<internal error>, val=<internal error>) [Z:\home\pitust\code\wwce\third_party\u8_emu\src\core\instr.c:271] in wwce-emu (0x0151fd10) mm, yeah its this (edited)instr.c line 271 val |= (-1) << oper->flags;third_party/u8_emu/src/core/instr.c:271:15: runtime error: left shift of negative value -1
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior third_party/u8_emu/src/core/instr.c:271:15 in
third_party/u8_emu/src/core/instr_impl.c:222:16: runtime error: shift exponent 18446744073709551615 is too large for 64-bit type 'uint64_t' (aka 'unsigned long')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior third_party/u8_emu/src/core/instr_impl.c:222:16 in psw |= ((val >> (shift - 1)) & 1) << 7; this is illegal (instr_shift) (edited)unknown argument -help when i pass --help arg to them...-h / --helpunknown argument -help when i pass --help arg to them... Windows Registry Editor Version 5.00
[HKCU\Console]
VirtualTerminalLevel=dword:00000001 (edited)Windows Registry Editor Version 5.00
[HKCU\Console]
VirtualTerminalLevel=dword:00000001 (edited)$ ./wwce-emu config.cfg
W: you are using a config file. we recommend you use rom8 instead, it's much better!
... (edited)$ ./wwce-emu config.cfg
W: you are using a config file. we recommend you use rom8 instead, it's much better!
... (edited)F800H is the low bit, 8:9000H is the high bitF800H is the low bit, 8:9000H is the high bitpkgconf is 2.1.0<keysym> <x> <y> <w> <h>, then i just feed this into chatgpt
These lines below are in the format `<keysym> <x> <y> <w> <h>`. You will convert each line to the format `var keys in var x <x> var y <y> var w <w> var h <h> var keysym <keysym> end`.
```
keymap data goes here...
```0x70 41 293 48 38
0x71 95 301 48 38
0x72 187 293 32 23
0x73 233 323 21 31
0x74 262 301 48 38
0x80 316 293 48 38
0x60 38 364 49 29
0x61 92 364 49 29
0x62 152 323 21 31
0x63 187 363 32 23
0x64 264 364 49 29
0x65 318 364 49 29
0x50 43 411 49 29
0x51 97 411 49 29
0x52 151 411 49 29
0x53 205 411 49 29
0x54 259 411 49 29
0x55 313 411 49 29
0x40 43 457 49 29
0x41 97 457 49 29
0x42 151 457 49 29
0x43 205 457 49 29
0x44 259 457 49 29
0x45 313 457 49 29
0x30 43 503 49 29
0x31 97 503 49 29
0x32 151 503 49 29
0x33 205 503 49 29
0x34 259 503 49 29
0x35 313 503 49 29
0x20 42 550 61 41
0x21 107 550 61 41
0x22 172 550 61 41
0x23 237 550 61 41
0x24 302 550 61 41
0x10 42 607 61 41
0x11 107 607 61 41
0x12 172 607 61 41
0x13 237 607 61 41
0x14 302 607 61 41
0x00 42 664 61 41
0x01 107 664 61 41
0x02 172 664 61 41
0x03 237 664 61 41
0x04 302 664 61 41
0x46 42 721 61 41
0x36 107 721 61 41
0x26 172 721 61 41
0x16 237 721 61 41
0x06 302 721 61 41libcairo, stb_image and rsvg and still no image (edited)libcairo, stb_image and rsvg and still no image (edited)cc1: warning: command line option ‘-fno-rtti’ is valid for C++/D/ObjC++ but not for C and fatal error: concepts: No such file or directory errorsg++?F00EHNUM_getIntAux:
0:BA42H F8CE PUSH LR
0:BA44H F0015DB6 BL ENTER
0:BA48H E1F8 ADD SP, -08H
0:BA4AH F805 MOV ER8, ER0
0:BA4CH 8B30 MOV R11, R3
0:BA4EH 8020 MOV R0, R2
0:BA50H 1001 ADD R0, #01H
0:BA52H 8A00 MOV R10, R0
0:BA54H F085 MOV ER0, ER8
0:BA56H F2018C8E BL NUM_getDigit
0:BA5AH 0100 MOV R1, #00H
0:BA5CH F405 MOV ER4, ER0
0:BA5EH E600 MOV ER6, #00H
0:BA60H 0002 MOV R0, #02H
0:BA62H 8C00 MOV R12, R0
0:BA64H CE1C BAL .l_05C
.l_024:
0:BA66H DAF9 ST R10, -7H[FP]
0:BA68H 1A01 ADD R10, #01H
0:BA6AH F46E PUSH XR4
0:BA6CH E00A MOV ER0, #0AH
0:BA6EH E200 MOV ER2, #00H
0:BA70H F06E PUSH XR0
0:BA72H F1012AD8 BL lmulu8lw
0:BA76H E104 ADD SP, +04H
0:BA78H F02E POP XR0
0:BA7AH B0FA ST ER0, -6H[FP]
0:BA7CH B2FC ST ER2, -4H[FP]
0:BA7EH D279 L R2, -7H[FP]
0:BA80H F085 MOV ER0, ER8
0:BA82H F2018C8E BL NUM_getDigit
0:BA86H 0100 MOV R1, #00H
0:BA88H E200 MOV ER2, #00H
0:BA8AH B47A L ER4, -6H[FP]
0:BA8CH B67C L ER6, -4H[FP]
0:BA8EH F046 ADD ER0, ER4
0:BA90H 8266 ADDC R2, R6
0:BA92H 8376 ADDC R3, R7
0:BA94H F405 MOV ER4, ER0
0:BA96H F625 MOV ER6, ER2
0:BA98H 80C0 MOV R0, R12
0:BA9AH 1001 ADD R0, #01H
0:BA9CH 8C00 MOV R12, R0
.l_05C:
0:BA9EH 80B7 CMP R0, R11
0:BAA0H C3E2 BLE .l_024
0:BAA2H F045 MOV ER0, ER4
0:BAA4H F265 MOV ER2, ER6
0:BAA6H F0005DBE B LEAVE1:BA62H appears to contain an SWI #4updateIndicators:
1:BA5EH 00D4 MOV R0, #D4H
1:BA60H 01E5 MOV R1, #E5H
1:BA62H E504 SWI 4
1:BA64H F205 MOV ER2, ER0
1:BA66H 0001 MOV R0, #01H
1:BA68H 8233 OR R2, R3
1:BA6AH C801 BNE .l_010
1:BA6CH 0000 MOV R0, #00H
.l_010:
1:BA6EH FE1F RTrender
in stead the official emulator reads er0 (which contains the address of the buffer when swi01 is called) when swi 01 is executed (edited)render
in stead the official emulator reads er0 (which contains the address of the buffer when swi01 is called) when swi 01 is executed (edited) <g id="TI30XPRIO_KEY_7_NONE" class="TI30XPRIO_KEY_7_NONE">
<rect x="60" y="375" class="ti_key_background_padding" width="48" height="44"></rect>
<path class="ti_numpadKey" d="M102,415H66c-1.1,0-2-0.9-2-2v-26c0-4.4,3.6-8,8-8h30c1.1,0,2,0.9,2,2v32C104,414.1,103.1,415,102,415z"></path>
<g>
<polygon class="ti_numpadKey_art_primary" points="87.8,403.8 80,403.8 81,402 88.8,402 "></polygon>
<path class="ti_numpadKey_art_primary" d="M88.7,396.1v1.7l-5.8,12h-2.7l5.8-11.5l0,0h-6.4v-2.1L88.7,396.1L88.7,396.1z"></path>
</g>
</g>if config.hardware_id == 6 (6 = ti mathprint)if (stpacp & 0xa0 == 0xa0)
stop_accept[1] = true;
else if (stpacp & 0x50 != 0x50)
stop_accept[0] = false;if (stpacp & 0xa0 == 0xa0)
stop_accept[1] = true;
else if (stpacp & 0x50 != 0x50)
stop_accept[0] = false; c++
Maybe<img::Image> loadpng(img::Format f, uint8_t* img, size_t imglen, double ds) {
int x, y, channels;
uint8_t* dat = stbi_load_from_memory(img, imglen, &x, &y, &channels, 3);
if (channels != 3) {
err("non-3-channel image data is unsupported (build with libcairo instead)");
return {};
}
uint8_t* imgbuf = new uint8_t[x * y * 4];
free(dat);
return img::Image{imgbuf, uint32_t(x), uint32_t(y), 1};
}$ obj/wwce-as -pc 0 'mov r1, 0x34'
0134 mov r1, 0x34 wwce's integrated assembler is now actually exposed and like half-working (edited)ea! even come from(hl+) from GB-Z80, (a7)+ from M68k, but no I've never seen ea! (edited)ldr x1, [x0, #4]! (edited)bi [01jj jjjj] (edited)0ijjpywin32 from the reqs, and commenting out the VIDEODRIVER env var override), but something crashes with the SDL windowpywin32 from the reqs, and commenting out the VIDEODRIVER env var override), but something crashes with the SDL window [someNullObject doStuff] (edited)./xlibpkgconf/iter.h isn't foundE: different linker and compiler target!E: third_party/u8_emu/src/core does not resolve to anything (edited) git submodule update --init --recursive --force && git clean -xdf && git submodule foreach --recursive git clean -fdx && make clean lolI: mem: 0xf024 <- 0xf
I: mem: 0xf025 <- 0x0
I: mem: 0xf020 <- 0x9e
I: mem: 0xf021 <- 0x7
I: mem: 0xf025 <- 0x1
I: mem: 0xf024 <- 0x1
I: mem: 0xf025 <- 0x0
I: mem: 0xf020 <- 0xa0
I: mem: 0xf021 <- 0xf
I: mem: 0xf025 <- 0x1 what do all these writes do?sqrt( frac thing in "basic overflow" on my emulator[=] the lower part of the screen is invisiblestrcpy expects a \0 at 8E00h but that byte is writeable in my emulator so it proceeds all the way down to SFR area
]
diff --git a/src/core/instr.c b/src/core/instr.c
index 9efcb6d..a06dfdc 100644
--- a/src/core/instr.c
+++ b/src/core/instr.c
@@ -205,15 +205,25 @@ static struct u8_instr u8_instr_table[] = {
#define NUM_INSTRS sizeof(u8_instr_table)/sizeof(struct u8_instr)
-struct u8_instr *u8_decode(uint16_t instr) {
+static uint16_t andbits[NUM_INSTRS], eqbits[NUM_INSTRS];
+static int did_init = 0;
+
+void u8_init() {
for (int x = 0; x < NUM_INSTRS; x++) {
// Generate the mask
uint16_t mask = 0;
if (u8_instr_table[x].op0.handler != NULL) mask |= u8_instr_table[x].op0.mask;
if (u8_instr_table[x].op1.handler != NULL) mask |= u8_instr_table[x].op1.mask;
mask ^= 0xffff;
-
- if ((instr & mask) == u8_instr_table[x].mask) return &u8_instr_table[x];
+ andbits[x] = mask;
+ eqbits[x] = u8_instr_table[x].mask;
+ }
+ did_init = 1;
+}
+struct u8_instr *u8_decode(uint16_t instr) {
+ if (!did_init) u8_init();
+ for (int x = 0; x < NUM_INSTRS; x++) {
+ if ((instr & andbits[x]) == eqbits[x]) return &u8_instr_table[x];
}
return NULL;D:\GWE\git\u8-emu-frontend\u8_emu>git apply u8emu.diff
error: corrupt patch at line 120D:\GWE\git\u8-emu-frontend\u8_emu>git apply u8emu.diff
error: corrupt patch at line 120 if ((instr & andbits[x]) == eqbits[x]) { this is the most often hit line of code memcpy(&val, &core->mem.regions[i].array[addr], size);D:\GWE\git\u8-emu-frontend\u8_emu>git apply u8emu.diff
error: corrupt patch at line 120 sh perfwrap.sh obj/wwce-testrun ran
1.18 ± 0.05 times faster than sh perfwrap.sh obj/wwce-testrun.oldsahf \ <do calculation here> \ lahf and then store AH to somewhere elsesahf \ <do calculation here> \ lahf and then store AH to somewhere else bitand(old value, 2) if theres a writeunnamed_function_ names come from ghidra WASM pluginreturn if (26840[0]:ubyte != 0 & 26844[0]:int != -1) {
24224[0]:int = 1;
0;
} else {
-1
}export function U():int {
return
if (26840[0]:ubyte != 0 & 26844[0]:int != -1) { f_jh() } else { -1 }
}thats executeexport function S():int {
var a:int_ptr = g_a - 16;
g_a = a;
a[3] = 24220[0]:int;
var b:int = a[3];
g_a = a + 16;
return b;
} this is GetCount hmmexport function T():int {
return
if (26840[0]:ubyte != 0 & 26844[0]:int != -1) { 24213[0]:ubyte } else { -1 }
} and yeah most of the others (GetSimRun here) wont do anything unless the values are 0 and -1function f_eaa() {
26840[0]:byte = f_zz();
f_qz();
} the first one is set hereexport function ca(a:int, b:int):int {
return
if (26840[0]:ubyte != 0 & 26844[0]:int != -1) { f_nfa(a, b) } else { -1 }
} ReadRegf_anf_hea is unnamed_function_8130xf0000005 error despite patching EXE(01.00.0000.0000) as opposed to (02.01.0030.0000)(01.00.0000.0000) as opposed to (02.01.0030.0000) #if defined (__LITTLE_ENDIAN__) || defined (__x86_64__) || defined (__i686__) || defined (__aarch64__)
...
#else
#error big endian is not big fast!
#endifGY454X)GY454X): 8929GY455X): 8928'4'+9 == '5'+8, that's the relationship between their checksum & model nameGY465X and LY720X as wellEY string is hard coded into the checksum code, the version string is stored as an ordinary string at the start of the ROM which the checksum code reads from. the version at the end of the ROM is only used for checksum calculation and the calculator ID.) (edited)b0(n=0), b1(n=1), b2(n=2), b3(n=3) BCDRAM[n*16:n*16+12] = BCDRAM[current source:current source + 12]
1011 nn mm and mov rM, rN i think (edited)|, ,|
|||, ,|||
|||||-@-|||||
|||` `|||
|` `| (edited)__builtin_FUNCTION() (edited)__func__, __FUNCTION__ and __PRETTY_FUNCTION__ (gcc) and __FUNCSIG__ (msvc) (edited)c++
void MMU::WriteData(size_t offset, uint8_t data, const char* str = __builtin_FUNCTION()) (edited)__PRETTY_FUNCTION__
Note:Functions about `0xF404` and `0xF405` are not simulated as they seem to be never called in Casio calculators. (edited)2222 and send the trace to me?2222 and send the trace to me? LoadStore it is from U8 code, if not its from BCD codeI: x add r0, r1
I: x xchg r0, r1
I: x sub r0, r1
I: r BCDERR
(repeat) (edited)r1, r0 = r0 + r1, r1
r0 = r0 - r1r1 += r0
r0 = -r0 (edited) ins_word = self.read_cmem(self.sim.core.regs.pc, self.sim.core.regs.csr)
# BL Cadr
if ins_word & 0xf0ff == 0xf001: self.call_trace.insert(0, [self.read_cmem(self.sim.core.regs.pc+2, self.sim.core.regs.csr), (self.sim.core.regs.csr << 16) + (self.sim.core.regs.pc + 4) & 0xfffe])
# BL ERn
elif ins_word & 0xff0f == 0xf003: self.call_trace.insert(0, [self.sim.read_reg_er(ins_word >> 4 & 0xf), (self.sim.core.regs.csr << 16) + (self.sim.core.regs.pc + 2) & 0xfffe])
# RT/POP PC
elif ins_word == 0xfe1f or ins_word & 0xf2ff == 0xf28e:
if len(self.call_trace) > 0: del self.call_trace[0]> log.txtLoadStore is U8 code, otherwise it is BCD code-- diverged at line 102130
-> mem[f4a9] = 0 (exp 4)
-> BCDr0 = 545981500331442390781010
-> BCDr1 = 4000000000000000000000
-> BCDr2 = 400
-> BCDr3 = 598150033144239078100580W BCD 0xF4A9 0x04 this occurs on this write they do -> BCDSEL = RUN
-> BCDr0 = 0x111122223333444455556666
-> BCDr1 = 0x777788889999aaaabbbbcccc
setup:
-> BCDCMD = shlc r0, 3 ; 0xcc
-> BCDFUCK0 = 0x8
-> BCDr0 = 0x333344445555666600000000 okay i have this new test vectorE: BCD selftest error: expected 0x333344445555666600000000, found 0xccccbbbb1111222233334444: shrc max width practical issue 0x1D to F400H at 1:CAF2H, but in my emulator its a write 0x14 to F400H at 1:CB54H insteadf_1C564:
...
.l_0B6:
1:C61AH F101CA8A BL f_1CA8A
1:C61EH C13E BLT .l_138
...
.l_138:
1:C69CH F101CB4E BL f_1CB4E
...1:C61EH# self.disas_hi = 17
instructions = ['']*self.disas_hi
middle = self.disas_hi // 2
cur_csr = regs.csr
cur_pc = regs.pc
format_ins = lambda i, ins_len, inst, offset = 0: f'{">>>" if i == middle else " "} {cur_csr:X}:{cur_pc + offset:04X}H {"".join(format(self.sim.read_cmem((cur_pc + offset + i*2) & 0xfffe, cur_csr), "04X") for i in range(ins_len // 2)):<13} {inst}'
# This grabs the disassembly after the current instruction
for i in range(middle, self.disas_hi):
ins, ins_len = self.sim.decode_instruction(cur_csr, cur_pc)
instructions[i] = format_ins(i, ins_len, ins)
cur_pc = (cur_pc + ins_len) & 0xfffe
i = middle - 1
cur_pc = regs.pc
# This grabs the disassembly before the current instruction. Kinda works but very flawed.
while i > -1:
cur_pc = (cur_pc - 6) & 0xfffe
ins, ins_len = self.sim.decode_instruction(cur_csr, cur_pc)
if ins_len < 6:
ins2, ins_len2 = self.sim.decode_instruction(cur_csr, cur_pc + ins_len)
if ins_len2 < 6 - ins_len:
ins3, ins_len3 = self.sim.decode_instruction(cur_csr, cur_pc + ins_len + ins_len2)
if ins_len3 > 2:
ins_len3 = 2
ins3 += '\t; misaligned'
instructions[i] = format_ins(i, ins_len3, ins3, ins_len + ins_len2)
i -= 1
if i < 0: break
instructions[i] = format_ins(i, ins_len2, ins2, ins_len)
i -= 1
if i < 0: break
instructions[i] = format_ins(i, ins_len, ins)
else:
instructions[i] = format_ins(i, ins_len2, ins2, ins_len)
i -= 1
if i < 0: break
instructions[i] = format_ins(i, ins_len, ins)
else:
instructions[i] = format_ins(i, ins_len, ins)
i -= 10:B006H is not misaligned anymore but it still displays 0:B008H0:B004H then 0:B006H then 0:B00AHsys.platform is win32./[path]/[path]
If the path is not specified./[path]/[path]
If the path is not specified sys.platform is win32 (edited)termios.h doesnt exist on mingwF037H is set then write to the hi screen buffer, else write to the low one (edited)5A 3C to F312H3C is written F031H is set to 3 (turns off the screen) and execution halts immediatelyF014H.1, you need to have that bit set when a key is pressed for keyboard to workF014H.1, you need to have that bit set when a key is pressed for keyboard to work F014H.1 is set and stop mode is disabled, if MIE is set it will jump to the corresponding address in vector tableF0D0H, F0D1H and F0D2H.
to emulate a working battery, check for a write with value 5 to F0D1H. at this time, if F0D0H is 3 and F0D2H is 0, set F0D1H to 6.
1F310H.4, here i modify it on fx-580VN X real ROM emulator to get Solar MODEL OK!F310H.4, here i modify it on fx-580VN X real ROM emulator to get Solar MODEL OK! F310H.4, here i modify it on fx-580VN X real ROM emulator to get Solar MODEL OK! fx991cnx folder
1
git pull if you cloned the repogit pull if you cloned the repo git pull if you cloned the repo requirements.txthuy@192:~/Desktop/u8-emu-frontend> python3 main.py
File "main.py", line 1925
if (url := self.get_qr()) is not None:
^
SyntaxError: invalid syntaxpython3 --versionpython3 --version requirements.txtwin32clipboard is part of pywin32 (edited)win32clipboard for windows, klembord for other systems (edited)git pulledwin32clipboard for windows, klembord for other systems (edited)git pullhuy@192:~/Documents> git pull https://github.com/gamingwithevets/u8-emu-frontendfatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).cd to the clone directorycd u8-emu-frontend; git pullhuy@192:~/u8-emu-frontend> git pull
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 3 (delta 2), reused 3 (delta 2), pack-reused 0
Unpacking objects: 100% (3/3), 466 bytes | 155.00 KiB/s, done.
From https://github.com/gamingwithevets/u8-emu-frontend
25ce646..ac5f95e main -> origin/main
Updating 25ce646..ac5f95e
Fast-forward
main.py | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
huy@192:~/u8-emu-frontend> python3 main.py and you will seegit pull againpython check_compat.py:= operator was added in 3.8Please install pygame...python main.pyhuy@192:~/u8-emu-frontend> python3.11 main.py
[08/05/2024 12:20:34] INFO: Importing config script config.py
[08/05/2024 12:20:34] INFO: Config script imported sucessfully
[08/05/2024 12:20:34] ERROR: [FileNotFoundError] rom.bin: No such file or directory (2) (full traceback below)
[08/05/2024 12:20:34] ERROR: Traceback (most recent call last):
[08/05/2024 12:20:34] ERROR: File "/home/huy/u8-emu-frontend/main.py", line 2309, in <module>
[08/05/2024 12:20:34] ERROR: sim = Sim(no_clipboard, bcd)
[08/05/2024 12:20:34] ERROR: ^^^^^^^^^^^^^^^^^^^^^^
[08/05/2024 12:20:34] ERROR: File "/home/huy/u8-emu-frontend/main.py", line 1229, in __init__
[08/05/2024 12:20:34] ERROR: rom = open(config.rom_file, 'rb').read()
[08/05/2024 12:20:34] ERROR: ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[08/05/2024 12:20:34] ERROR: FileNotFoundError: [Errno 2] No such file or directory: 'rom.bin'
huy@192:~/u8-emu-frontend> nvm this is weirder than i expectedpython main.py configs\config_fx580vnx.pypython main.py configs\config_fx580vnx.py python3 main.py configs/config_fx580vnx.pyhuy@192:~/u8-emu-frontend> python3.11 main.py configs\config_fx580vnx.py
[08/05/2024 12:30:47] INFO: Importing config script configsconfig_fx580vnx.py
Traceback (most recent call last):
File "/home/huy/u8-emu-frontend/main.py", line 2287, in <module>
spec.loader.exec_module(config)
File "<frozen importlib._bootstrap_external>", line 936, in exec_module
File "<frozen importlib._bootstrap_external>", line 1073, in get_code
File "<frozen importlib._bootstrap_external>", line 1130, in get_data
FileNotFoundError: [Errno 2] No such file or directory: '/home/huy/u8-emu-frontend/configsconfig_fx580vnx.py'
huy@192:~/u8-emu-frontend>plt.legend(["red", "green", "blue"]) though the normal order is blue → orange → greenGY-450 VerE112Ceh0:2EBAh00d7 and up because EA is d71 keycode and this is what happensgy454xe (edited)0B0C6 getscancode # void (keyinfo* er0)
# where keyinfo = struct { char ki; char ko; }
0B45E getkeycode # handle modifier keys
# (for example shift+1 has different keycode from 1) (edited)[ER0] should hold the KI and KO value of the pressed key80F2H02C04 num_output_print # takes num*, if == NULL then print '' (edited)num_output_print is always called[ER0]num_output_print...char_print with R0=col, R1=row, R2=charline_print?buffer_clear_lastnline called0:7BACH?0:B9BEH (edited)0:6B12H0x50 and 0xA0 to F008H, then writes 0x02 to F009H
these 3 things must happen in order for stop mode to be enabledF022H will count up and when it reaches the value of the word at F020H then exit stop mode and set F014H to 0x20 (edited)F014H to 280xxH)Documents\My Games\Retro\Gadgets8E01H for KI, 8E02H for KO8E00H when stop mode is enabled, if it is 0, ignore it, if it is 2, ignore it ONLY if [AC] is pressed, or else write 0 to itaa bb cc dd like this?34 7b 31 30 01 30 5c ea c8 3d 32 30 7e 94 30 30
34 7b 31 30 11 30 6d ea c8 3d 32 30 7e 94 30 30
34 7b 31 30 21 30 7e ea c8 3d 32 30 7e 94 30 30
34 7b 31 30 31 30 8f ea c8 3d 32 30 7e 94 30 30
74 89 31 30 00 00 02 26 31 30 39 f0 a6 a8 30 30
39 f0 a8 9f 30 30 d8 39 31 30 74 89 31 30 01 00
a0 9c 30 30 30 30 39 f0 02 26 31 30 01 05 3c 9f
30 30 78 5c 31 30 2a ea 83 3f 32 30 61 61 61 61
61 61 61 61 61 61 61 61 61 61 61 61 61 62 62 62
62 62 62 62 62 62 62 62 62 62 62 62 62 62 63 63
63 63 63 63 63 63 63 63 63 63 63 63 63 63 63 64
64 64 64 64 64 64 64 64 64 64 64 64 64 64 64 6434 7b 31 30 01 30 f4 ea c8 3d 32 30 7e 94 30 30
34 7b 31 30 11 30 05 eb c8 3d 32 30 7e 94 30 30
34 7b 31 30 21 30 16 eb c8 3d 32 30 7e 94 30 30
34 7b 31 30 31 30 27 eb c8 3d 32 30 7e 94 30 30
74 89 31 30 00 00 02 26 31 30 38 f0 a6 a8 30 30
38 f0 a8 9f 30 30 d8 39 31 30 74 89 31 30 00 01
02 26 31 30 50 01 3c 9f 30 30 74 89 31 30 38 f0
9e 3b 31 30 a8 9f 30 30 70 ea 30 30 30 30 a8 9f
30 30 8a 9e 30 30 a8 9f 30 30 8a 9e 30 30 a6 50
32 30 38 f0 a8 9f 30 30 30 33 31 30 50 01 3c 9f
30 30 74 89 31 30 00 01 a0 9c 30 30 30 30 38 f0
02 26 31 30 50 01 3c 9f 30 30 a8 9f 30 30 74 89
31 30 38 f0 9e 3b 31 30 a8 9f 30 30 70 ea 30 30
30 30 a8 9f 30 30 8a 9e 30 30 a8 9f 30 30 8a 9e
30 30 74 89 31 30 00 01 a8 9f 30 30 8a 9e 30 30
a6 50 32 30 38 f0 a8 9f 30 30 30 33 31 30 01 01
02 26 31 30 50 01 3c 9f 30 30 78 5c 31 30 30 ea
83 3f 32 30 61 61 61 61 61 61 61 61 61 61 61 61
61 61 61 61 61 62 62 62 62 62 62 62 62 62 62 62
62 62 62 62 62 62 63 63 63 63 63 63 63 63 63 63
63 63 63 63 63 63 63 64 64 64 64 64 64 64 64 64
64 64 64 64 64 64 64 64 (edited)<34 bytes> 78 5c 31 30 de e9 60 0d 32 48inja={34,7b,31,30,01,30,5c,ea,c8,3d,32,30,7e,94,30,30,34,7b,31,30,11,30,6d,ea,c8,3d,32,30,7e,94,30,30,34,7b,31,30,21,30,7e,ea,c8,3d,32,30,7e,94,30,30,34,7b,31,30,31,30,8f,ea,c8,3d,32,30,7e,94,30,30,74,89,31,30,00,00,02,26,31,30,39,f0,a6,a8,30,30,39,f0,a8,9f,30,30,d8,39,31,30,74,89,31,30,01,00,a0,9c,30,30,30,30,39,f0,02,26,31,30,01,05,3c,9f,30,30,78,5c,31,30,2a,ea,83,3f,32,30,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,61,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,62,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,63,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64}0x before hexinja={0x34,0x7b,0x31,0x30,0x01,0x30,0x5c,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x11,0x30,0x6d,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x21,0x30,0x7e,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x31,0x30,0x8f,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x74,0x89,0x31,0x30,0x00,0x00,0x02,0x26,0x31,0x30,0x39,0xf0,0xa6,0xa8,0x30,0x30,0x39,0xf0,0xa8,0x9f,0x30,0x30,0xd8,0x39,0x31,0x30,0x74,0x89,0x31,0x30,0x01,0x00,0xa0,0x9c,0x30,0x30,0x30,0x30,0x39,0xf0,0x02,0x26,0x31,0x30,0x01,0x05,0x3c,0x9f,0x30,0x30,0x78,0x5c,0x31,0x30,0x2a,0xea,0x83,0x3f,0x32,0x30,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64}34 7b 31 30
39 f0 01 30
d2 03 32 3001 into F039, it means our inja script has probleminja={0x34,0x7b,0x31,0x30,0x01,0x30,0x5c,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x11,0x30,0x6d,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x21,0x30,0x7e,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x31,0x30,0x8f,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x74,0x89,0x31,0x30,0x00,0x00,0x02,0x26,0x31,0x30,0x39,0xf0,0xa6,0xa8,0x30,0x30,0x39,0xf0,0xa8,0x9f,0x30,0x30,0xd8,0x39,0x31,0x30,0x74,0x89,0x31,0x30,0x01,0x00,0xa0,0x9c,0x30,0x30,0x30,0x30,0x39,0xf0,0x02,0x26,0x31,0x30,0x01,0x05,0x3c,0x9f,0x30,0x30,0x78,0x5c,0x31,0x30,0x2a,0xea,0x83,0x3f,0x32,0x30,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64}<34 bytes> 78 5c 31 30 de e9 60 0d 32 48 inja={0x34,0x7b,0x31,0x30,0x01,0x30,0x62,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x11,0x30,0x73,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x21,0x30,0x84,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x31,0x30,0x95,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x74,0x89,0x31,0x30,0x00,0x00,0x02,0x26,0x31,0x30,0x39,0xf0,0xa6,0xa8,0x30,0x30,0x39,0xf0,0xa8,0x9f,0x30,0x30,0xd8,0x39,0x31,0x30,0x74,0x89,0x31,0x30,0x00,0x01,0x74,0x89,0x31,0x30,0x00,0x01,0xa0,0x9c,0x30,0x30,0x30,0x30,0x39,0xf0,0x02,0x26,0x31,0x30,0x01,0x05,0x3c,0x9f,0x30,0x30,0x78,0x5c,0x31,0x30,0x30,0xea,0x83,0x3f,0x32,0x30,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64} injb={0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x5c,0x31,0x30,0xde,0xe9,0x60,0x0d,0x32,0x48} for i=0,500 do data[i+0xe9e0]=inja[i+1] end for i=0,50 do data[i+0xd180]=injb[i+1] end<34 bytes> 78 5c 31 30 de e9 60 0d 32 48injb={0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x5c,0x31,0x30,0xde,0xe9,0x60,0x0d,0x32,0x48} for i=0,500 do data[i+0xe9e0]=inja[i+1] end for i=0,50 do data[i+0xd180]=injb[i+1] endan_mode(110,0xd180)casioemumsvc fx580vnx script=lua-common.lua
1inja={0x34,0x7b,0x31,0x30,0x01,0x30,0x62,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x11,0x30,0x73,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x21,0x30,0x84,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x34,0x7b,0x31,0x30,0x31,0x30,0x95,0xea,0xc8,0x3d,0x32,0x30,0x7e,0x94,0x30,0x30,0x74,0x89,0x31,0x30,0x00,0x00,0x02,0x26,0x31,0x30,0x39,0xf0,0xa6,0xa8,0x30,0x30,0x39,0xf0,0xa8,0x9f,0x30,0x30,0xd8,0x39,0x31,0x30,0x74,0x89,0x31,0x30,0x00,0x01,0x74,0x89,0x31,0x30,0x00,0x01,0xa0,0x9c,0x30,0x30,0x30,0x30,0x39,0xf0,0x02,0x26,0x31,0x30,0x01,0x05,0x3c,0x9f,0x30,0x30,0x78,0x5c,0x31,0x30,0x30,0xea,0x83,0x3f,0x32,0x30,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x62,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x63,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64,0x64} injb={0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x78,0x5c,0x31,0x30,0xde,0xe9,0x60,0x0d,0x32,0x48} for i=0,500 do data[i+0xe9e0]=inja[i+1] end for i=0,50 do data[i+0xd180]=injb[i+1] end casioemumsvc.exe?( after doing 1/1roverflow normallydiagnostic, draw_byte, etc( cause the stack to go into the end of the equation buffer (edited)( cause the stack to go into the end of the equation buffer (edited)( 85651 0.041 0.000 0.054 0.000 main.py:1749(keyboard)
well looks like keyboard takes a lot of time 85651 0.041 0.000 0.054 0.000 main.py:1749(keyboard)
well looks like keyboard takes a lot of time def keyboard(self):
ki = 0xff
if len(self.keys_pressed) > 0:
ko = self.sim.sfr[0x44] ^ 0xff if self.ko_mode else self.sim.sfr[0x46]
try:
for val in self.keys_pressed:
if val == None: continue
if ko & (1 << val[1]): ki &= ~(1 << val[0])
except RuntimeError: pass
self.sim.sfr[0x40] = ki
if not config.real_hardware:
temp = self.read_emu_kb(0)
if temp in (2, 8) and [self.read_emu_kb(i) for i in (1, 2)] != [1<<2, 1<<4]: self.write_emu_kb(0, 0)
elif temp in (5, 7) and not self.qr_active:
self.qr_active = True
tk.messagebox.showinfo('QR code', 'Detected emulator ROM QR code!\nGet the URL with right-click > Extra functions > QR code export > Copy URL to clipboard\n\nNote: due to the nature of the emulator, you might not see the QR code immediately')
elif temp == 6: self.qr_active = False
1
1 def keyboard(self):
ki = 0xff
if len(self.keys_pressed) > 0:
ko = self.sim.sfr[0x44] ^ 0xff if self.ko_mode else self.sim.sfr[0x46]
try:
for val in self.keys_pressed:
if val == None: continue
if ko & (1 << val[1]): ki &= ~(1 << val[0])
except RuntimeError: pass
self.sim.sfr[0x40] = ki
if not config.real_hardware:
temp = self.read_emu_kb(0)
if temp in (2, 8) and [self.read_emu_kb(i) for i in (1, 2)] != [1<<2, 1<<4]: self.write_emu_kb(0, 0)
elif temp in (5, 7) and not self.qr_active:
self.qr_active = True
tk.messagebox.showinfo('QR code', 'Detected emulator ROM QR code!\nGet the URL with right-click > Extra functions > QR code export > Copy URL to clipboard\n\nNote: due to the nature of the emulator, you might not see the QR code immediately')
elif temp == 6: self.qr_active = False an like reset 68an hackstring in equation modex=aain>cmto build fdfdc0

00h (normally mode 68), the calculator will act like it is in SYSTEM mode00h (normally mode 68), the calculator will act like it is in SYSTEM mode uint16_t MMU::ReadCode(size_t offset)
{
if (offset >= (1 << 20))
PANIC("offset doesn't fit 20 bits\n");
if (offset & 1)
PANIC("offset has LSB set\n");
size_t segment_index = offset >> 16;
size_t segment_offset = offset & 0xFFFF;
if (!segment_index)
return (((uint16_t)emulator.chipset.rom_data[segment_offset + 1]) << 8) | emulator.chipset.rom_data[segment_offset];
MemoryByte *segment = segment_dispatch[segment_index];
if (!segment)
{
emulator.HandleMemoryError();
return 0;
}
MMURegion *region = segment[segment_offset].region;
if (!region)
{
emulator.HandleMemoryError();
return 0;
}
return (((uint16_t)region->read(region, offset + 1)) << 8) | region->read(region, offset);
}
why reading code from other than segment 0 is actually reading data memory mem_edit.ReadFn = [](const ImU8* data, size_t off) -> ImU8 {
return me_mmu->ReadData(off + 0x9000);
};
mem_edit.WriteFn = [](ImU8* data, size_t off, ImU8 d) {
return me_mmu->WriteData(off + 0x9000, d);
};
size_t v = 0x9188;Command.cpp line 74Ui.cpp now#if to support multi languageIn file included from src/Gui/imgui/imgui.h:85,
from src/Gui/imgui/imgui_impl_sdl2.h:22,
from src/casioemu.cpp:2:
src/Gui/hex.hpp: In member function 'void MemoryEditor::DrawContents(void*, size_t, size_t, const OptionalMarkedSpans&)':
src/Gui/hex.hpp:579:68: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
579 | assert(intxn_start >= line_start_n && intxn_end <= line_end_n);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~
src/Gui/hex.hpp:579:97: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'unsigned int'} and 'int' [-Wsign-compare]
579 | assert(intxn_start >= line_start_n && intxn_end <= line_end_n);
| ~~~~~~~~~~^~~~~~~~~~~~~